Releases: elixir-image/image
Image version 0.28.0
Bug Fixes
- Fixes resizing images with alpha bands. Resizing images with alpha bands requires premultiplying the alpha band into the image and reversing that after resizing.
Enhancements
-
Adds
Image.warp_perspective/4
to apply a warp transformation to an image. Thanks very much to @sodapopcan for the PR and collaboration. -
Adds
Image.straighten_perspective/3
to apply a warp perspective that straighens the image. It is basicallyImage.warp_perspective/4
with algorithmically deriveddestination
parameter. -
Adds
Image.map/2
which applies a transformation matrix (not a convolution kernel) to an image. A transformation matrix can be returned fromImage.transform_matrix/3
. These two functions underpinImage.warp_perspective/4
. -
Adds
Image.crop/2
which is a variation ofImage.crop/5
that takes the same format of bounding box as that applied toImage.warp_perspective/4
making it easy to apply a warp transform and then crop to the transformed area. Note that cropping requires that the bounding box be a rectangle, not an arbitrary quadrilateral.
Image version 0.27.0
Enhancements
-
Add
Image.from_kino/2
andImage.from_kino!/2
to simplify create an image from a Kino image in Livebook. -
Add
Image.average/1
andImage.average!/1
to calulate the average color of an image. -
Add
Image.center_crop/3
andImage.center_crop!/3
-
Add
Image.embed/4
andImage.embed!/4
to embed an image in a larger canvas, generating additional border pixels as required. -
Add
Image.Shape.rect/3
to draw a rectangle image.
Image packaging future
In a future release, Image will be split into several packages
:image
which will retain all the core components of image transformation based uponvix
andlibvips
.:image_nx
which will provide:nx
interoperability (and will depend on:image
):image_exif
which will provide metadata support (and will depend on:image
):image_classification
which will provide image classification (and will depend on:image
and:bumblebee
):image_generation
which will provide image generation (and will depend on:image
and:bumblebee
):image_detection
which will provide object detection (and will depend on:image
,:axon
,:axon_onnx
):image_qrcode
which will provide QRcode scanning and production (and will depend on:image
and:evision
):image_video
which will provide video frame extraction (and will depend on:image
and:evision
)
Image version 0.26.0
Breaking change
Image.avatar/3
is nowImage.avatar/2
. Thesize
parameter is now the:size
option. The default value of 180 pixels remains.
Enhancements
Image.avatar/2
takes a:shape
option that is either:circle
(the default) or:square
. This allows the generation of either circular or square avatars.
Bug Fixes
-
Fix
Image.open/2
for SVG binaries and add note to show that SVG images can be opened. -
Fix
Image.avatar/2
to square the image after thumbnailing but before applying any mask. This ensures a circular mask is centred on the thumbnailed image. -
Fix
Image.avatar/2
for image path parameters which no correctly flattens the image. -
Fix
Image.avatar!/2
to accept either an image or an image path.
Image version 0.25.1
Bug Fixes
-
Fix
is_webp/1
guard and downcase all suffixes before validation. Thanks to @quentin-bettoum for the report and fix. Closes #64. -
Fix
Image.avatar/3
to flatten the source image before compositing with the mask. Thanks to @jarrodmoldrich for the report. Closes #63. -
Fix
Image.flatten/1
to only flatten if there is an alpha band.
Image version 0.25.0
Behavior Change
- The default access mode for
Image.open/2
is nowaccess: :random
in line withlibvips
native default. Althoughaccess: :sequential
optimizes for many cases (especially with regard to memory) it resulted in poor developer experience since the error messages when trying to re-use aaccess: :sequential
image are difficult to understand and very difficult to re-interpret inimage
.
Bug Fixes
-
Adds
:heic
and:avif
suffixes to the list of valid suffixes forheif
file formats. Thanks to @quentin-bettoum for the PR. Closes #50. -
Allows specifying the option
padding: 0
forImage.Text.text/2
. Previously this only supported positive integers. -
Fix
Image.write/3
documentation. Thanks to @jeregrine for the PR. Closes #62.
Enhancements
-
Update
README.md
to include updated documentation for installinglibvips
withVix
. -
Adds
:x
and:y
options toImage.Text.text/2
which allows placing the text on its background in the specified location.:x
can be specified as a non-negative integer or one of:left
,:right
or:center
with the default being:center
.:y
can be specified as a non-negative integer or one of:top
,:bottom
or:middle
with the default being:middle
. Thanks to @severian1778 for the issue and collaboration. Closes #44. -
Adds an option
:effort
toImage.write/3
for:png
,:heif
,:heic
,:avif
and:webp
images that determines the amount of CPU effort permitted when compressing the image data. Thanks to @quentin-bettoum for the PR. Closes #45.
Image version 0.24.1
Bug Fixes
-
Fixes
:weight
option handling inImage.meme/3
to include:ultralight
. Thanks to @quentin-bettoum. Closes #42. -
Fixes
:intent
option handling inImage.thumbnail/3
. Thanks to @quentin-bettoum. Closes #43.
Image version 0.24.0
Enhancements
-
Adds
Image.Draw.flood!/4
to aligns withImage.Draw.flood/4
. -
Adds
Image.add_alpha/2
andImage.add_alpha!/2
. -
Adds
:stroke_width
toImage.Draw.rect/6
andImage.Draw.circle/5
. Thanks to @RyoWakabayashi for the suggestion and sample code.
Image version 0.23.2
Bug Fixes
Image.Kino.show/2
returns the typet:Kino.Image.t/0
which as a side effect does not show a duplicate image and plays nicely withKino.Layout.grid/2
. Thanks to @RyoWakabayashi. Closes #37.
Image version 0.23.0
Bug Fixes
-
Fix specs for
Image.Options.Write
. Thanks to @jarrodmoldrich. Closes #36. -
Fix spec for
Image.exif/1
. Thanks to @ntodd for the PR. Closes #35.
Enhancements
-
Adds
Image.normalize/1
which normalizes an image by expanding the luminance of an image to cover the full dynamic range. -
Adds
Image.autolevel/1
which cales each band of an image to fit the full dynamic range. UnlikeImage.normalize/1
, each band is scaled separately. -
Adds
Image.erode/2
which erodes pixels from the edge of an image mask. This can be useful to remove a small amount of colour fringing around the edge of an image. -
Adds
Image.dilate/2
which dilates pixels from the edge of an image mask. -
Adds
Image.trim/2
which trims an image to the bounding box of the non-background area. -
Adds
Image.flatten/1
which flattens an alpha layer out of an image -
Image.Options.Write.validate_options/2
now validates options appropriate to each image type in order to make validation more robust. -
Adds
:minimize_file_size
option toImage.write/2
for JPEG and PNG files which iftrue
will apply a range of techniques to minimize the size of the image file at the expense of time to save the image and potentially image quality.
Image version 0.22.1
Bug Fixes
- Don't compile
Image.Options.Video
unless Evision is configured and compiled.