Skip to content

Image import

Sven edited this page Nov 5, 2018 · 1 revision

Image import Vers. 1.2.1.

The main problem when importing images is the color assignment: each image color must be assigned a limited number of tool (pen) colors, so called color quantization. Some image filters from AForge were implemented with realtime update to improove the color quantization. To cover wavy edges in horizontal drawing mode, a surrounding outline can be drawn. Note: when "outline" is enabled, the image processing works internally with up to 5x resolution for a smooth outline, which slows down the real-time update.

Internally the color processing works with three images:

  • 'original' image from loading, stays untouched - Keep the button "Original" pressed to check image.
  • 'adjusted' image shows the result after applying all filters to the original image.
  • 'result' image simulates the plotter output, white background shows areas where no tool will be applied - Keep the button "Preview" pressed to check result.

Open Image via file dialog, drag & drop or copy & paste.

Example picture was copied & pasted from google picture search result "keith haring flying devil".

After loading an image, the first tab shows some information:

  • amount of colors (original image)
    • Note: JPG images usually have many more colors than obviously visible, due to compression artifacts
  • Number of pens (= amount of tools/colors in tool table)
  • Size of original and result image

Tab 1

Use predefined settings to convert image:
  • Comic - few colors

    • preset brightness, contrast, gamma
    • reduce amount of colors to amount of tool-colors using AForge 'color quantiziser'
      which exceeds the setted occurence in %
    • set exception color to white (otherwise white background would be replaced by brightest color in tool-table - e.g. 'apricot')
    • remove isolated pixels
    • finally use color replacing 'Distance in RGB space'
  • Graphic - many colors

    • apply AForge 'Posterize' filter
    • finally use color replacing 'Distance in color hue, saturation and brightness' (HSV color range)
  • Image - dark background

    • set saturation
    • apply AForge 'channel filtering' to set dark areas to black
    • set exception color to black
    • uncheck "Draw outline" to save processing time
  • Contour

    • set grayscale mode
    • apply AForge 'Edge filter'
    • set adjusted image to new original image
    • invert image
    • set max. colors to two

Or do manual settings on the corresponding tabs

Tab 2

Set the dimension and resolution (= pen width) of the result image.

Tab 3

Apply some filters.

Tab 4

Set final color quantization and deselect colors (= tools) if not needed.

Tab 5

Finally check gcode parameters for conversion.
Note: using "Draw outline" causes image processing with up to 5x higher resolution to get smooth outline path. This will slow down the realtime update.


(first image, 'Comic' preset and deselected colors yellow and red, Output width = 100, resolution = 1):

horizontal with outline

outline only
You can’t perform that action at this time.