Skip to content

Releases: elixir-image/image

Image version 0.28.0

06 Apr 05:04
Compare
Choose a tag to compare

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 basically Image.warp_perspective/4 with algorithmically derived destination parameter.

  • Adds Image.map/2 which applies a transformation matrix (not a convolution kernel) to an image. A transformation matrix can be returned from Image.transform_matrix/3. These two functions underpin Image.warp_perspective/4.

  • Adds Image.crop/2 which is a variation of Image.crop/5 that takes the same format of bounding box as that applied to Image.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

20 Mar 03:00
Compare
Choose a tag to compare

Enhancements

  • Add Image.from_kino/2 and Image.from_kino!/2 to simplify create an image from a Kino image in Livebook.

  • Add Image.average/1 and Image.average!/1 to calulate the average color of an image.

  • Add Image.center_crop/3 and Image.center_crop!/3

  • Add Image.embed/4 and Image.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 upon vix and libvips.
  • :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

12 Mar 10:05
Compare
Choose a tag to compare

Breaking change

  • Image.avatar/3 is now Image.avatar/2. The size 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

01 Mar 15:52
Compare
Choose a tag to compare

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

01 Mar 03:58
Compare
Choose a tag to compare

Behavior Change

  • The default access mode for Image.open/2 is now access: :random in line with libvips native default. Although access: :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 a access: :sequential image are difficult to understand and very difficult to re-interpret in image.

Bug Fixes

  • Adds :heic and :avif suffixes to the list of valid suffixes for heif file formats. Thanks to @quentin-bettoum for the PR. Closes #50.

  • Allows specifying the option padding: 0 for Image.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 installing libvips with Vix.

  • Adds :x and :y options to Image.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 to Image.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

14 Feb 16:37
Compare
Choose a tag to compare

Bug Fixes

  • Fixes :weight option handling in Image.meme/3 to include :ultralight. Thanks to @quentin-bettoum. Closes #42.

  • Fixes :intent option handling in Image.thumbnail/3. Thanks to @quentin-bettoum. Closes #43.

Image version 0.24.0

06 Feb 10:14
Compare
Choose a tag to compare

Enhancements

  • Adds Image.Draw.flood!/4 to aligns with Image.Draw.flood/4.

  • Adds Image.add_alpha/2 and Image.add_alpha!/2.

  • Adds :stroke_width to Image.Draw.rect/6 and Image.Draw.circle/5. Thanks to @RyoWakabayashi for the suggestion and sample code.

Image version 0.23.2

31 Jan 14:53
Compare
Choose a tag to compare

Bug Fixes

  • Image.Kino.show/2 returns the type t:Kino.Image.t/0 which as a side effect does not show a duplicate image and plays nicely with Kino.Layout.grid/2. Thanks to @RyoWakabayashi. Closes #37.

Image version 0.23.0

29 Jan 14:23
Compare
Choose a tag to compare

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. Unlike Image.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 to Image.write/2 for JPEG and PNG files which if true 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

09 Jan 08:53
Compare
Choose a tag to compare

Bug Fixes

  • Don't compile Image.Options.Video unless Evision is configured and compiled.