Pixopedia Documentation

Print

6.4. Image processing

Image processing (menu entry: Tools -> Image processing)

Image processing tool consist of a number of image processing actions which can be loosely grouped in several categories: color modification (colors reduction), geometric transforms, image enhancement and miscellaneous image processing routines. Also, some routines, such as geometric transforms, will invoke modal form, while other routines can be previewed or applied immediately (if selection exists, action will be applied only to selected area).  Here is a list of currently available image processing actions:

  • Decrease colors number (reduces number of colors in image without modifying pixel depth):
    • Current palette color luminance: luminance value for each pixel in current image/layer is calculated. Luminance value is checked against current palette (256 colors) luminance. Palette color with smallest luminance difference replaces image pixel color.
    • Current palette nearest color: palette colors are treated as simple numbers end are sorted. Binary search is used to find nearest color for input pixel color.
    • Current palette pseudo-colors (grayscale indexing): luminance value is calculated from image pixel and rounded to nearest integer value. This value is used as palette index to retreave palette color which replaces unput pixel color.
    • NeoQuant color quantization: modified octree algorithm is used to reduce image colors. Additional parameter (Colors*) is used to set max. number of colors used for quantization.
  • Reduce color bits (reduces image pixel bits without modifying pixel depth):
    • Dithering type: five modes are available; none (no-dithering), Floyd-Steinberg, Jarvice-Judice-Ninke, Stuckey and Bayer.
    • Additional parameters: noise and level.
  • Convert to BW (converts image to BW without modifying pixel depth):
    • Methods available: Ordered dithering, BW averaged, BW threshold and Maximum  entropy. Note: all methods convert color image to black and white image, but image pixel format is not reduced/changed; image retains  24-bits depth, but image palette consists only from two colors.
    • Threshold: for methods requiring threshold value (BW threshold); a value that separates black and white pixels.
    • Remove isolated pixels: option to remove isolated pixels (black or white). Additional parameter (grouping) sets estimated “hole” size.
    • Remove noise: option to remove eventually noise while converting to BW. Additional parameter (iterations) sets number of iterations for noise removal algorithm.
  • Grayscale/halftone (converts image to gray-scale image without modifying pixel depth):
    • Method: Luminance, Intensity and Custom.
    • Red, Green, Blue sliders: percentage  of red/green/blue channel values for conversion. When Luminance or Intensity methods are selected, these values are preset and can not be changed. When Custom method is selected, user can set any value for RGB.
  • Mirror  (mirrors or flips image or selection):
    • Mirroring types: flip (horizontal axis), mirror (vertical axis) or flip & mirror (both axis).
  • Arithmetic & logic (applies arithmetic or logic operation between image pixels color and some preset single value):
    • Negative: current image negative.
    • Custom: performs custom operation (associated combo box selection) using custom value parameter as second operand.
  • Distance transform (requires IPP):
    • Method: Mask 3×3, Mask 5×5 and Fast marching. First two algorithms uses fixed mask, while the last one uses additional parameter (radius).
    • Masked method norm: used in conjunction with masked methods; combo box with three norm types (Inf, L1 and L2).
    • Radius*: used in conjunction with fast marching algorithm; sets the radius value.
    • Coi (channels of interest): you can include or exclude any of image RGB channels from distance transform.
  • Tessellation (Voronoi – Delaunay); invokes modal form glued to processing options panel:
    • Start sites #: number of sites to start with when seeding.
    • End sites #: maximum number of sites that can be created through iterations.
    • Iterations: number of iterations.
    • Level error: permitted pixel colors difference between two iterations used to “glue” together areas of similar color.
    • Tessellate (preview): performs multi-pass tessellation and draws result onto current image canvas.
    • Display options (combo box): Voronoi – displays Voronoi diagram, Delaunay solid – displays Voronoi complement (triangulation) with solid color, Delaunay with Gouraud shading – displays Daulanay triangles shaded with Gouraud algorithm .
    • Edge type: No edges – no edges between tessellated areas, Custom edge color – user can select border color, Vertex edge color – vertex color is used as edge color, Curr. brush edge (mask) – current brush is used to draw edges.
    • Edge width: edge width, brush pen width.
    • Blur mask: blurs mask with given radius when current brush color is used.
    • Redraw (preview): when tessellation is performed, changing display option and edge type does not require re-tessellation. Pressing this button will change output immediately.
    • Accept/Discard: save or cancel current drawing; closes modal form.
  • Rotate (background image); rotates image (background image only):
    • Rotate and maintain size (crop out): rotates image around specified center of rotation by desired angle and crops image to maintain the original size.
    • Rotate and maintain size (skew inside): rotates image without changing image size and without cropping. Image is skewed inside original image bounding rectangle and filled with specified color.
    • Rotate and maintain size (resize inside): rotates image without changing image size and without cropping. Rotated image is resized to fit original image bounding rectangle. Empty areas are filled with specified color.
    • Rotate and adjust size: image is rotated and size is adjust to fit rotated image.
    • Rotation filter: combo box for selecting rotation filter interpolation algorithm.
    • Backfill color: color combo box for selecting color used to fill non-rotated image area.
    • Angle: angle of rotation in degrees.
    • X center/Y center: normalized [0, 1] factor to set X and Y values for rotation center.
    • Accept/Discard: save or cancel current rotation; closes modal form.
  • Resize (background image); resizes image (background image only):
    • Resample filter: resize interpolation algorithm.
    • Maintain aspect ratio: if checked, image width and height ratio will be kept constant. When unchecked, width and height values can be set independently.
    • WH*2, 1:1 WH/2: resize by factor 2, reset to original size, shrink image by half.
    • Width/Height: adjust image width and height.
    • Accept/Discard: save or cancel current resize mode; closes modal form.
  • Resize/stretch inside (background image); performs image resizing or stretching inside original image bounding rectangle:
    • Resample filter: same as in resize operation.
    • Maintain aspect ratio: if checked, maintains aspect ratio when resizing image.
    • Scroll: if checked, dragging with mouse on assistant image, pans the view. If unchecked, dragging with mouse on assistant image, draws selection rectangle that will be used for image stretching.
    • Assistant image: shows a preview of resized/stretch image. As previously mentioned, when Scroll check-box is unchecked, drawing a selection rectangle performs “selection zoom in” operation; a part of image image is zoomed/resized to fit original image bounding rectangle/box
    • Accept/Discard: save or cancel current resize mode; closes modal form.
  • Enlarge canvas (background image); enlarges image canvas, while keeping original image inside new (enlarged) canvas  (background image only):
    • Backfill color: color selection used to set color for canvas border.
    • Maintain aspect ratio: keeps fixed aspect ratio.
    • Width/Height: width and height value for new (enlarged) canvas.
    • Image position: position of original image inside new (enlarged) canvas.
    • Accept/Discard: save or cancel image with enlarged canvas; closes modal form.
  • Margins cut-off (background image); resizes image by cutting desired portion of image margins (background image only):
    • Proportional margins: if checked, changing one margin value, affects all others.
    • Cut values: top, left, right and bottom; values specifying pixel how much rows/columns will be cut from each image edge.
    • Accept/Discard: save or cancel image with cut margins; closes modal form.
  • Add or remove alpha channel (image transparency); adds or removes alpha channel:
    • Trans. color: selected color that will be set to transparent (when adding alpha channel) or used for color merging (when removing alpha channel).
    • Merge color:if checked, the specified Trans. color is merged with the semitransparent areas of the image (like a shadow).
  • Remove red eye; removes red eye artifacts from current image/layer (best when selection is used).
  • Wallis filter; apply Wallis filter to current image/layer. For parameters meaning, please search for Wallis filter algorithm.
  • Adjust gain offset/balance; applies gain offset and balance methods to current image/layer:
    • Adjust gain offset:  adjusts image luminosity by calculating the min and max pixels values and stretching the colors to the maximum allowed value.
    • Auto white balance: adjusts image colors by automatically adjusting the white range.
    • Gray world white balance: adjusts image colors by applying the white balance algorithm “Gray World”.
  • Auto image enhancement I; performs a series of complex operations to improve the contrast and colors in the image/layer:
    • Subsample size: for better performance, operations are performed on a subsampled image. This parameter specifies the image width (default 60).
    • Slope: the core function slope (in degrees) which will affect the contrast. Allowed values: 0 to 90°, default 20.
    • Cut: the core function range which will affect the contrast. Allowed values are 0 to 100, default 25.
    • Neighbour: when the subsampled image is used to change the full size image, Neighbour specifies the window size of the conversion. High values slow down processing but produce better results. Default is 2.
  • Auto image enhancement II; performs image/layer enhancement using a “Retinex” algorithm to simulate how humans see the world:
    • Scale count: the algorithm is applied to different scales of the image. This parameter specifies the number of scales. Default 3.
    • Scale curve: specifies how build the size of each scale. Allowed values [0, 2]. Default 2.
    • Variance: the output variance. Default 1.8.
    • Scale high: allowed values [16, 250]. Default 200.
    • Luminance: if checked, algorithm is applied only to luminance (luminosity) channel, so the algorithm doesn’t touch colors.
  • Auto image enhancement III; enhances luminosity of image/layer by applying a local adaptation tone mapping algorithm:
    • Gamma: adjusts the resulting luminosity. Value must be more than 0.
    • Saturation: adjusts the color saturation. Allowed values range: [-100, 100].
  • Deconvolve; performs Lucy-Richardson deconlvolution algorithm on current image/layer:
    • PSF size: kernel size.
    • Threshold: value of threshold level (to exclude dividing by zero).
    • Iterations: number of algorithm iterations.
  • Histogram; shows current image/layer histogram and performs various histogram/statistical color modification operations (requires IPP):
    • Predefined LUTs: various predefined lookup table operations.
    • LUT curve: user defined LUTs (currently not available – under development).
    • Levels: number of LUT entries used for modifying image: [2, 256].
    • Interpolation: interpolation algorithm for LUT modification operations (nearest neighbor, linear, cubic).
    • Note: to change type of histogram, use RMB on histogram graph to invoke pop-up menu.

That’s it for now. More image processing operations are under development (chroma key, etc..).