### Install Image Library Dependencies Source: https://hexdocs.pm/image/image_edge_masking Installs the necessary Image library along with Req and Kino for image processing and interactive development. ```elixir Mix.install([ {:image, "~> 0.42"}, {:req, "> 0.0.0"}, {:kino, "> 0.0.0"} ]) ``` -------------------------------- ### Fix Image Application Start Function Source: https://hexdocs.pm/image/changelog Fixes `Image.Application.start/2` to correctly handle cases where Bumblebee is not configured. Previously, it would return `nil`, which is not a valid return for an application start function. ```elixir Image.Application.start/2 ``` -------------------------------- ### Image.histogram/1 Example Source: https://hexdocs.pm/image/changelog Provides an example for `Image.histogram/1` to demonstrate the structure and interpretation of the returned histogram data. This helps users understand the distribution of pixel values within an image. ```Elixir Image.histogram/1 ``` -------------------------------- ### Install Dependencies for SAM Project Source: https://hexdocs.pm/image/segment_anything Installs necessary Elixir dependencies for the Segment Anything Model (SAM) project using Ortex. Includes libraries like ortex, image, nx_image, exla, kino, and req. ```Elixir Mix.install([{:ortex,"~> 0.1.9"},{:image,"~> 0.47"},{:nx_image,"~> 0.1.2"},{:exla,"~> 0.7.2"},{:kino,"~> 0.12.3"},{:req,"~> 0.4"}]) ``` -------------------------------- ### Install libvips on Linux Source: https://hexdocs.pm/image/readme This command installs the libvips development package on Debian-based Linux systems using apt. This is necessary for compiling Vix NIFs with platform-provided libvips. ```Shell apt install libvips-dev ``` -------------------------------- ### Install Dependencies and Configure Inspect Source: https://hexdocs.pm/image/color_clustering Installs necessary Elixir dependencies for image processing and configures the Inspect module for better output formatting during development. ```Elixir Mix.install([{:nx,"~> 0.7"},{:nx_image,"~> 0.1"},{:scholar,"~> 0.3"},{:exla,"~> 0.7"},{:kino,"~> 0.13"},{:image,"~> 0.51"}],config:[nx:[default_backend:EXLA.Backend,default_defn_options:[compiler:EXLA]]]) previous_inspect=Inspect.Opts.default_inspect_fun() Inspect.Opts.default_inspect_fun(fnterm,opts->previous_inspect.(term,%Inspect.Opts{opts|charlists::as_lists})end) ``` -------------------------------- ### Install libvips on macOS Source: https://hexdocs.pm/image/readme This command installs the libvips library on macOS using Homebrew. This is required when you need to use platform-provided libvips with Vix (and thus Image) for extended format support. ```Shell brew install libvips ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/color_clustering Lists the supported backend systems for video processing. This helps in selecting the appropriate library for video operations. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Get Default Options for New Image Source: https://hexdocs.pm/image/color_clustering Provides the default configuration options when creating a new image. This sets up basic image properties. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Get Default New Image Options Source: https://hexdocs.pm/image/api-reference Retrieves the default options for creating a new image. This function provides a starting point for image creation configurations. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Initial eVision Support for QR Codes (Elixir) Source: https://hexdocs.pm/image/changelog Provides initial integration with eVision, offering the `Image.QRcode.decode/1` function for QR code decoding. Users need to install eVision separately as it's not yet on hex.pm. ```Elixir Add initial support for eVision. In this release the function `Image.QRcode.decode/1` is provided to decode images that contain a QRcode. See the `eVision` repository for installation instructions since this library is not yet on `hex.pm`. ``` -------------------------------- ### Get Default Options for Text Source: https://hexdocs.pm/image/color_clustering Provides default configuration for adding text to images, including font, size, and color. ```Elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### Install eVision Dependency Source: https://hexdocs.pm/image/readme Adds the eVision dependency to your Elixir project's mix.exs file. This allows integration with OpenCV for computer vision tasks. ```Elixir defdepsdo[ # ...{:evision,"~> 0.1"} ]end ``` -------------------------------- ### Get Default New Image Options Source: https://hexdocs.pm/image/changelog Provides default options for creating a new image. This function is part of the Image.Options.New module. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/color_clustering Lists all supported blend modes for image composition, such as 'normal', 'multiply', 'screen', etc. ```Elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### Install Bumblebee and EXLA Dependencies Source: https://hexdocs.pm/image/readme This snippet shows how to add 'Bumblebee' and 'exla' to your Elixir project's `mix.exs`. These are needed for integrating machine learning models and ensuring adequate performance for image classification and other tasks. ```Elixir defdepsdo[# ...{:bumblebee,"~> 0.1"},{:exla,"~> 0.4"}]end ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/thumbnailing Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Get Default Image Options Source: https://hexdocs.pm/image/Image.Options Retrieves the default options for creating a new image. This function provides a baseline configuration for image creation. ```elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/changelog Retrieves a list of known backend types for video processing. This function is part of the Image.Options.Video module. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Install Nx Dependency Source: https://hexdocs.pm/image/readme This snippet demonstrates adding the 'Nx' library to your Elixir project's `mix.exs`. Nx is required for certain Image functionalities, especially those involving machine learning models and eVision integration. ```Elixir defdepsdo[# ...{:nx,"~> 0.4"}]end ``` -------------------------------- ### Get Project Dependencies Source: https://hexdocs.pm/image/readme This command fetches all the dependencies listed in your Elixir project's `mix.exs` file. It's a standard step after modifying dependencies or setting up a new project. ```Shell mixdeps.get ``` -------------------------------- ### Saving the Final Image Source: https://hexdocs.pm/image/image_edge_masking Provides a commented-out example of how to save the processed image to a file, emphasizing the need for formats that support transparency like PNG. ```Elixir # Image.write(final_image, "some/path/to/final_image.png") ``` -------------------------------- ### Prepare Inputs for Decoder and Run Source: https://hexdocs.pm/image/segment_anything Prepares input points, labels, and mask inputs for the decoder model. It then runs the decoder model with the image embeddings and prepared inputs to generate masks and scores. ```Elixir # prepare inputs # xy box coordinates in our image of the object we want to detour # input_point = Nx.tensor([[345, 272], [640, 760]]) |> Nx.as_type(:f32) |> Nx.reshape({1, 2, 2}) # 2, 3 is for box startig / end points # input_label = Nx.tensor([2, 3]) |> Nx.reshape({1, 2}) |> Nx.as_type(:f32) # single point input_point=Nx.tensor([[514,514],[0,0]])|>Nx.as_type(:f32)|>Nx.reshape({1,2,2}) input_label=Nx.tensor([1,-1])|>Nx.reshape({1,2})|>Nx.as_type(:f32) # Filled with 0, not used heremask_input=Nx.broadcast(0,{1,1,256,256})|>Nx.as_type(:f32) # not using mask_inputhas_mask=Nx.broadcast(0,1)|>Nx.as_type(:f32) original_image_dim=Nx.tensor([1024,1024])|>Nx.as_type(:f32) {mask,scores,low_res}=Ortex.run(decoder,{Nx.broadcast(image_embeddings,{1,256,64,64}),Nx.broadcast(input_point,{1,2,2}),Nx.broadcast(input_label,{1,2}),Nx.broadcast(mask_input,{1,1,256,256}),Nx.broadcast(has_mask,{1}),Nx.broadcast(original_image_dim,{2})}) ``` -------------------------------- ### Generating an Avatar Image Source: https://hexdocs.pm/image/thumbnailing Provides an example of using the Image.avatar function to generate a circular avatar image from a given image, specifying the desired size. ```elixir Image.avatar(image, 200) ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/Image Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/Image.Options Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/Image.Options Retrieves a list of known backend types supported for video processing. This function lists the available video processing engines. ```elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Get Default New Image Options Source: https://hexdocs.pm/image/readme Retrieves the default options for creating a new image. This function provides a base configuration for new image instances. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/Image Retrieves a list of known video backends supported for image processing. This function returns the available video processing engines. ```Elixir Image.Video.known_backends/0 ``` -------------------------------- ### Get Default New Image Options Source: https://hexdocs.pm/image/license Retrieves the default options for creating a new image. This function provides a base configuration for new image instances. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Add Documentation for Image.with_colorspace/3 Source: https://hexdocs.pm/image/changelog Includes documentation for the Image.with_colorspace/3 function. ```Elixir Image.with_colorspace/3 ``` -------------------------------- ### Get Known Interpretations Source: https://hexdocs.pm/image/changelog Retrieves a list of all known image interpretations. This function is part of the Image.Interpretation module. ```Elixir Image.Interpretation.known_interpretations/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/thumbnailing Retrieves a list of known backend types for video processing. This function provides information about supported video processing engines. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/license Retrieves a list of known backend types for video processing. This function provides information about supported video processing engines. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/color_clustering Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Add Image Interpretation Function (Elixir) Source: https://hexdocs.pm/image/changelog Adds `Image.interpretation/1` to get the color interpretation or color space of an image. ```Elixir Add `Image.interpretation/1` ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/api-reference Retrieves the default Image.BlendMode. This function provides the standard blend mode setting. ```Elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/changelog Retrieves the default blend mode for image operations. This function is part of the Image.BlendMode module. ```Elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Get Known Extend Modes Source: https://hexdocs.pm/image/changelog Retrieves a list of all supported image extend modes. This function is part of the Image.ExtendMode module. ```Elixir Image.ExtendMode.known_extend_modes/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/readme Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Get Default New Image Options Source: https://hexdocs.pm/image/thumbnailing Retrieves the default options for creating a new image. This function provides a base configuration for new image instances. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Document RTSP Video Stream Opening Source: https://hexdocs.pm/image/changelog Adds documentation to Image.Video.open/2 to demonstrate how to open Real-Time Streaming Protocol (RTSP) video streams. ```Elixir Image.Video.open/2 ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/changelog Retrieves a list of all supported image blend modes. This function is part of the Image.BlendMode module. ```Elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/segment_anything Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Get Known Band Formats Source: https://hexdocs.pm/image/changelog Retrieves a list of all known image band formats. This function is part of the Image.BandFormat module. ```Elixir Image.BandFormat.known_band_formats/0 ``` -------------------------------- ### List Known Video Backends (Image.Video.known_backends) Source: https://hexdocs.pm/image/Image Retrieves a list of all valid video backend identifiers known to the system. These backends are recognized but may not be available in the current OpenCV setup. Refer to OpenCV documentation for details on specific backends. ```Elixir iex> Image.Video.known_backends() |> Enum.sort() [:android, :any, :aravis, :avfoundation, :cmu1394, :dc1394, :dshow, :ffmpeg, :fireware, :firewire, :giganetix, :gphoto2, :gstreamer, :ieee1394, :images, :intel_mfx, :intelperc, :msmf, :obsensor, :opencv_mjpeg, :openni, :openni2, :openni2_astra, :openni2_asus, :openni_asus, :pvapi, :qt, :realsense, :ueye, :unicap, :v4l, :v4l2, :vfw, :winrt, :xiapi, :xine] ``` -------------------------------- ### Get Default Text Options Source: https://hexdocs.pm/image/changelog Provides default options for adding text to an image. This function is part of the Image.Options.Text module. ```Elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/api-reference Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Get Default Meme Margin Source: https://hexdocs.pm/image/changelog Calculates the default margin for meme image generation. This function is part of the Image.Options.Meme module. ```Elixir Image.Options.Meme.default_margin/1 ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/thumbnailing Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/license Allows configuration of the underlying libvips library, including setting concurrency and retrieving the version. ```Elixir Image.get_concurrency/0 Image.put_concurrency/1 Image.vips_version/0 ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/color_clustering Returns the default blend mode used for image compositing operations. This is typically 'normal'. ```Elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/readme Retrieves a list of known backend types for video processing. This function provides information about supported video processing engines. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Get Known Kernels Source: https://hexdocs.pm/image/changelog Retrieves a list of all known image kernels for operations like convolution. This function is part of the Image.Kernel module. ```Elixir Image.Kernel.known_kernel/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/image_edge_masking Allows configuration of the underlying libvips library, including setting concurrency levels and checking the version. ```Elixir get_concurrency/0 put_concurrency/1 vips_version/0 ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/api-reference Retrieves a list of known backend types for video processing. This function provides information about supported video processing engines. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Get and Prepare Image Input Source: https://hexdocs.pm/image/segment_anything Reads an image uploaded via Kino Input, resizes it to 1024x1024 using Image.thumbnail!, and displays the original and resized images using Kino Layout. ```Elixir image_input=Kino.Input.image("Uploaded Image") image=Kino.Input.read(image_input)|>Image.from_kino!() resized=Image.thumbnail!(image,"1024x1024") original_label=Kino.Markdown.new("**Original image**") resized_label=Kino.Markdown.new("**Resized image**") Kino.Layout.grid([Kino.Layout.grid([image,original_label],boxed:true),Kino.Layout.grid([resized,resized_label],boxed:true)],columns:2) ``` -------------------------------- ### Get Known Extend Modes Source: https://hexdocs.pm/image/color_clustering Lists all supported extend modes for image processing, which define how image boundaries are handled during transformations. ```Elixir Image.ExtendMode.known_extend_modes/0 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/thumbnailing Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get Known Video Backends Source: https://hexdocs.pm/image/segment_anything Retrieves a list of known backend types for video processing. This function is useful for understanding supported video formats. ```Elixir Image.Options.Video.known_backends/0 ``` -------------------------------- ### Get Known Kernels Source: https://hexdocs.pm/image/color_clustering Lists all supported kernel types used in image filtering operations, such as convolution kernels for blurring or sharpening. ```Elixir Image.Kernel.known_kernel/0 ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/Image.Options Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### Get Known Interpretations Source: https://hexdocs.pm/image/color_clustering Lists all supported interpretations for image data, defining how pixel values should be understood (e.g., RGB, CMYK). ```Elixir Image.Interpretation.known_interpretations/0 ``` -------------------------------- ### Image Resizing and Cropping Source: https://hexdocs.pm/image/license Handles image resizing, thumbnail generation, and cropping. Includes options for embedding, trimming, and finding image boundaries. ```Elixir Image.embed/4 Image.find_trim/2 Image.find_trim!/2 Image.resize/3 Image.resize!/3 Image.thumbnail/3 Image.thumbnail!/3 Image.trim/2 Image.trim!/2 Image.center_crop/3 Image.center_crop!/3 Image.crop/2 Image.crop/5 Image.crop!/2 Image.crop!/5 ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/readme Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### Get Known Kernels Source: https://hexdocs.pm/image/api-reference Retrieves a list of all known Image.Kernel types. This function lists the available convolution kernels for image processing. ```Elixir Image.Kernel.known_kernel/0 ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/Image Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### Get Known Interpretations Source: https://hexdocs.pm/image/api-reference Retrieves a list of all known Image.Interpretation types. This function lists the available ways to interpret image data. ```Elixir Image.Interpretation.known_interpretations/0 ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/color_clustering Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### Image.get_pixel/3 - Get Pixel Value Source: https://hexdocs.pm/image/changelog Introduces `Image.get_pixel/3` to retrieve the color value of a specific pixel at given x and y coordinates within an image. ```Elixir Image.get_pixel(image, x, y) ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/api-reference Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### Get NX Format from Band Format Source: https://hexdocs.pm/image/Image Converts an image band format to its NX representation. This function is used for internal format conversions. ```Elixir Image.BandFormat.nx_format/1 ``` ```Elixir Image.BandFormat.nx_format!/1 ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/readme Retrieves the default blend mode for image compositing. This function provides a standard setting for combining images. ```Elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Get Default Text Options Source: https://hexdocs.pm/image/readme Retrieves the default options for adding text to an image. This function provides a base configuration for text overlays. ```Elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### libvips Configuration Source: https://hexdocs.pm/image/changelog Allows configuration of the underlying libvips library, including setting concurrency and retrieving the version. ```Elixir Image.get_concurrency/0 Image.put_concurrency/1 Image.vips_version/0 ``` -------------------------------- ### Configure Nx Backend for KMeans Source: https://hexdocs.pm/image/changelog Provides configuration for Nx backend and default definition options, likely beneficial for KMeans performance. ```Elixir config :nx, default_backend: EXLA.Backend config :nx, :default_defn_options, compiler: EXLA ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/license Retrieves the default blend mode for image compositing. This function provides a standard setting for combining images. ```Elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Open Video File or Stream (Image.Video.open) Source: https://hexdocs.pm/image/Image Opens a video source, such as a file, RTSP stream, or default camera, for frame extraction. It returns an `Evision.VideoCapture.t()` struct on success or an error tuple. Options can specify the backend processing system, defaulting to `:any` which selects the first available backend. ```Elixir @spec open( filename_or_stream :: Path.t() | stream_id(), Image.Options.Video.open_options() ) :: {:ok, Evision.VideoCapture.t()} | {:error, Image.error_message()} Opens a video file, camera, RTSP URL or video stream for frame extraction. Arguments: * `filename_or_stream` is the filename of a video file, the URL of an RTSP stream or the OpenCV representation of a video stream as an integer. It may also be `:default_camera` to open the default camera if there is one. * `options` is a keyword list of options. The default is `[]`. Options: * `:backend` specifies the backend video processing system to be used. The default is `:any` which means that the first available backend in the current OpenCV configuration will be used. The available backends can be returned by `Image.Video.available_backends/0`. ``` -------------------------------- ### Default New Image Options Source: https://hexdocs.pm/image/Image Provides default options for creating a new image. This function initializes a new image with standard settings. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Get Default Text Options Source: https://hexdocs.pm/image/license Retrieves the default options for adding text to an image. This function provides a base configuration for text overlays. ```Elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### Image Preview and Kino Integration Source: https://hexdocs.pm/image/segment_anything Provides functions for previewing images and integrating with the Kino environment. ```Elixir p/1 preview/1 to_kino/1 ``` -------------------------------- ### Image Resizing and Cropping Source: https://hexdocs.pm/image/changelog Handles image resizing, thumbnail generation, and cropping. Includes options for embedding, trimming, and finding image boundaries. ```Elixir Image.embed/4 Image.find_trim/2 Image.find_trim!/2 Image.resize/3 Image.resize!/3 Image.thumbnail/3 Image.thumbnail!/3 Image.trim/2 Image.trim!/2 Image.center_crop/3 Image.center_crop!/3 Image.crop/2 Image.crop/5 Image.crop!/2 Image.crop!/5 ``` -------------------------------- ### Get Known Extend Modes Source: https://hexdocs.pm/image/api-reference Retrieves a list of all known Image.ExtendMode types. This function lists the available methods for extending image boundaries. ```Elixir Image.ExtendMode.known_extend_modes/0 ``` -------------------------------- ### Get Known Band Formats Source: https://hexdocs.pm/image/api-reference Retrieves a list of all known Image.BandFormat types. This function provides an overview of supported image band formats. ```Elixir Image.BandFormat.known_band_formats/0 ``` -------------------------------- ### Elixir Function: available_backends() Source: https://hexdocs.pm/image/Image Retrieves a list of all available video processing backends that are configured and ready for use. Refer to OpenCV documentation for backend details. ```Elixir @spec available_backends() :: [Image.Options.Video.backend()] ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/api-reference Retrieves a list of all known Image.BlendMode types. This function lists the available blending modes for image operations. ```Elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### Fetch Project Dependencies Source: https://hexdocs.pm/image/readme Retrieves all project dependencies, including the newly added eVision, after updating the mix.exs file. ```Elixir mixdeps.get ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/Image.Options Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/thumbnailing Retrieves the default blend mode for image compositing. This function provides a standard setting for combining images. ```Elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/color_clustering Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get Default Text Options Source: https://hexdocs.pm/image/api-reference Retrieves the default options for adding text to an image. This function provides default settings for text rendering. ```Elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### Get Default Backend for NX Source: https://hexdocs.pm/image/segment_anything Retrieves the current default backend configured for the NX library. This helps in understanding which backend is being used for computations. ```Elixir Nx.default_backend() ``` -------------------------------- ### Get Default Text Options Source: https://hexdocs.pm/image/thumbnailing Retrieves the default options for adding text to an image. This function provides a base configuration for text overlays. ```Elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/api-reference Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get Default Text Options Source: https://hexdocs.pm/image/Image.Options Retrieves the default options for adding text to an image. This function provides default settings for text rendering. ```elixir Image.Options.Text.default_options/0 ``` -------------------------------- ### Image Social Media Handling (Resize, Usages, Platforms) Source: https://hexdocs.pm/image/thumbnailing Functions for managing social media image aspects, including resizing, tracking image usage, and identifying known platforms. ```Elixir Image.Social.resize/3 Image.Social.resize!/3 Image.Social.image_usages/1 Image.Social.known_platforms/0 Image.Social.media_sizes/0 Image.Social.default_image_usage/1 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/readme Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Thumbnailing with Crop Options Source: https://hexdocs.pm/image/thumbnailing Illustrates how to use the Image.thumbnail function with different cropping strategies, including no cropping and cropping based on image attention. ```elixir Image.thumbnail(image, 200, crop: :none) ``` ```elixir Image.thumbnail(image, 200, crop: :attention) ``` -------------------------------- ### Default Options for New Image Source: https://hexdocs.pm/image/segment_anything Provides default options for creating a new image. This function initializes image settings to their default values. ```Elixir Image.Options.New.default_options/0 ``` -------------------------------- ### Simplify Image Text Rendering with Pango Source: https://hexdocs.pm/image/changelog Refactors `Image.text/2` and `Image.simple_text/2` to exclusively use the Pango renderer, removing SVG rendering and certain options like `:text_stroke_color`, `:text_stroke_width`, and `:autofit`. Width and height are now optional. ```Elixir Image.text/2 Image.simple_text/2 ``` -------------------------------- ### Image.dominant_color/2 - Get Dominant Color Source: https://hexdocs.pm/image/changelog Adds `Image.dominant_color/2` to extract the most prominent color from an image. This function takes an image and an optional number of colors to consider. ```Elixir Image.dominant_color(image, num_colors) ``` -------------------------------- ### Get Known Kernels Source: https://hexdocs.pm/image/Image Retrieves a list of all known kernels for image convolution operations. This function provides a comprehensive list of supported kernel types. ```Elixir Image.Kernel.known_kernel/0 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/segment_anything Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get Known Interpretations Source: https://hexdocs.pm/image/Image Retrieves a list of all known image interpretations. This function provides a comprehensive list of supported ways to interpret image data. ```Elixir Image.Interpretation.known_interpretations/0 ``` -------------------------------- ### Support capturing images from video streams Source: https://hexdocs.pm/image/changelog Enables capturing images from video streams, not just video files, using `Image.Video.open(:default_camera)`. This expands the utility of the Image.Video module to real-time camera input. Note that image streams do not support seeking. ```Elixir Image.Video.open/1 ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/readme Retrieves a list of all known blend modes supported by the library. This function provides information on available compositing methods. ```Elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/license Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get Known Extend Modes Source: https://hexdocs.pm/image/readme Retrieves a list of all known extend modes for image processing. This function provides information on how image boundaries are handled. ```Elixir Image.ExtendMode.known_extend_modes/0 ``` -------------------------------- ### Image Resizing and Cropping Source: https://hexdocs.pm/image/thumbnailing Provides functions for resizing images to specific dimensions, creating thumbnails, embedding images, and cropping to various specifications. ```Elixir embed/4 find_trim/2 find_trim!/2 resize/3 resize!/3 thumbnail/3 thumbnail!/3 trim/2 trim!/2 center_crop/3 center_crop!/3 crop/2 crop/5 crop!/2 crop!/5 ``` -------------------------------- ### Image: Files and Streams (Elixir) Source: https://hexdocs.pm/image/Image Functions for creating and manipulating images from binary data, SVG, and streams. Includes functions for opening, writing, and creating new image instances. ```elixir iex> Image.from_binary(binary) %Image{} iex> Image.from_svg(svg_data) %Image{} iex> Image.new(width, height, color) %Image{} iex> Image.open(path, format) %Image{} iex> Image.stream!(image, format) {:ok, stream} iex> Image.write(image, path, format) :ok ``` -------------------------------- ### Get NX Format from Band Format Source: https://hexdocs.pm/image/readme Converts an Elixir Image BandFormat to its corresponding NX format identifier. This function is used for format interoperability. ```Elixir Image.BandFormat.nx_format/1 ``` ```Elixir Image.BandFormat.nx_format!/1 ``` -------------------------------- ### Get NX Format from Band Format Source: https://hexdocs.pm/image/color_clustering Converts a standard image band format to its corresponding NX (NervesKit) representation. This is useful for internal processing. ```Elixir Image.BandFormat.nx_format/1 ``` ```Elixir Image.BandFormat.nx_format!/1 ``` -------------------------------- ### Image Social Media Handling (Resize, Usages, Platforms) Source: https://hexdocs.pm/image/color_clustering Functions for managing social media image aspects, including resizing, tracking image usage, and identifying known platforms. ```Elixir Image.Social.resize/3 Image.Social.resize!/3 Image.Social.image_usages/1 Image.Social.known_platforms/0 Image.Social.media_sizes/0 Image.Social.default_image_usage/1 ``` -------------------------------- ### Generate Thumbnail from Image File Source: https://hexdocs.pm/image/thumbnailing This snippet demonstrates the basic process of reading an image file, creating a thumbnail with a specified size, and saving the thumbnail to a new file using Vix.Vips.Image functions. ```elixir original_raw = File.read!("/path/to_original.jpg"); {:ok, original} = Image.from_binary(original_raw) {:ok, thumbnail} = Image.thumbnail(original, 200) Image.write(thumbnail, "/tmp/thumbnail.png") Image.write(thumbnail, "/path/to_thumbnail.png") ``` -------------------------------- ### Get Known Band Formats Source: https://hexdocs.pm/image/color_clustering Retrieves a list of all supported image band formats. This includes formats like RGB, RGBA, Grayscale, etc. ```Elixir Image.BandFormat.known_band_formats/0 ``` -------------------------------- ### Get Known Extend Modes Source: https://hexdocs.pm/image/license Retrieves a list of all known extend modes for image processing. This function provides information on how image boundaries are handled. ```Elixir Image.ExtendMode.known_extend_modes/0 ``` -------------------------------- ### Add Image Nx Convenience Functions Source: https://hexdocs.pm/image/changelog Introduces Image.Nx to host convenience functions related to Nx. ```Elixir Image.Nx ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/license Retrieves a list of all known blend modes supported by the library. This function provides information on available compositing methods. ```Elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### Image Composition Options Source: https://hexdocs.pm/image/thumbnailing Provides default options for image composition. ```Elixir Image.Options.Compose.default_composit_options/0 ``` -------------------------------- ### Get NX Format from Band Format Source: https://hexdocs.pm/image/license Converts an Elixir Image BandFormat to its corresponding NX format identifier. This function is used for format interoperability. ```Elixir Image.BandFormat.nx_format/1 ``` ```Elixir Image.BandFormat.nx_format!/1 ``` -------------------------------- ### Get Default Margin for Meme Options Source: https://hexdocs.pm/image/color_clustering Retrieves the default margin value for meme image options. This is useful for setting initial text positioning. ```Elixir Image.Options.Meme.default_margin/1 ``` -------------------------------- ### Nx and Evision Integration Source: https://hexdocs.pm/image/thumbnailing Facilitates conversion between image formats and Nx/Evision representations for numerical processing. ```Elixir from_evision/1 from_nx/1 from_nx!/1 to_evision/2 to_list/1 to_nx/2 to_nx!/2 ``` -------------------------------- ### Image Social Media Handling (Resize, Usages, Platforms) Source: https://hexdocs.pm/image/api-reference Functions for managing social media image aspects, including resizing, tracking image usage, and identifying known platforms. ```Elixir Image.Social.resize/3 Image.Social.resize!/3 Image.Social.image_usages/1 Image.Social.known_platforms/0 Image.Social.media_sizes/0 Image.Social.default_image_usage/1 ``` -------------------------------- ### Get Known Extend Modes Source: https://hexdocs.pm/image/thumbnailing Retrieves a list of all known extend modes for image processing. This function provides information on how image boundaries are handled. ```Elixir Image.ExtendMode.known_extend_modes/0 ``` -------------------------------- ### Get NX Format from Band Format Source: https://hexdocs.pm/image/thumbnailing Converts an Elixir Image BandFormat to its corresponding NX format identifier. This function is used for format interoperability. ```Elixir Image.BandFormat.nx_format/1 ``` ```Elixir Image.BandFormat.nx_format!/1 ``` -------------------------------- ### Elixir Image Options for Opening Images Source: https://hexdocs.pm/image/api-reference Defines options and performs validation for the `Image.open/2` function, used for opening and loading image files. ```Elixir Image.Options.Open ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/thumbnailing Retrieves a list of all known blend modes supported by the library. This function provides information on available compositing methods. ```Elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### Get Known Interpretations Source: https://hexdocs.pm/image/segment_anything Retrieves a list of all known image interpretations, which define how pixel data should be interpreted (e.g., color space, data type). ```Elixir Image.Interpretation.known_interpretations/0 ``` -------------------------------- ### Open Base Image from URL Source: https://hexdocs.pm/image/image_edge_masking Opens a base image from a given URL using the Req library and then loads it into the Image library. This is typically used for initial image loading and processing. ```elixir {:ok, response} = Req.get("https://raw.githubusercontent.com/elixir-image/image/main/test/support/images/jigsaw.png") jigsaw = Image.open!(response.body) ``` -------------------------------- ### Get Known Blend Modes Source: https://hexdocs.pm/image/Image.Options Retrieves a list of all known blend modes supported for image operations. This function lists the available compositing methods. ```elixir Image.BlendMode.known_blend_modes/0 ``` -------------------------------- ### Support for vix prebuilt libvips with conditional FFT Source: https://hexdocs.pm/image/changelog Adds support for upcoming prebuilt `libvips` from `vix`. The inclusion of `Image.skew_angle/1` and `Image.fft/1` is conditional on the availability of `Vix.Vips.Operation.fft!/1`, as the prebuilt library might not include FFT dependencies. ```Elixir Image.skew_angle/1 ``` ```Elixir Image.fft/1 ``` ```Elixir Vix.Vips.Operation.fft!/1 ``` -------------------------------- ### Get Default Blend Mode Source: https://hexdocs.pm/image/Image.Options Retrieves the default blend mode for image compositing. This function provides the standard blending mode when none is specified. ```elixir Image.BlendMode.default_blend_mode/0 ``` -------------------------------- ### Image Resizing and Cropping Source: https://hexdocs.pm/image/readme Provides functions for resizing images to specific dimensions, creating thumbnails, embedding images, and cropping to various specifications. ```Elixir embed/4 find_trim/2 find_trim!/2 resize/3 resize!/3 thumbnail/3 thumbnail!/3 trim/2 trim!/2 center_crop/3 center_crop!/3 crop/2 crop/5 crop!/2 crop!/5 ``` -------------------------------- ### Image Resizing and Cropping Source: https://hexdocs.pm/image/Image.Options Provides functions for resizing images to specific dimensions, creating thumbnails, embedding images, and cropping to various specifications. ```Elixir embed/4 find_trim/2 find_trim!/2 resize/3 resize!/3 thumbnail/3 thumbnail!/3 trim/2 trim!/2 center_crop/3 center_crop!/3 crop/2 crop/5 crop!/2 crop!/5 ```