Floyd Steinberg dithering in GraphicsMagic or ImageMagic
Asked Answered
G

1

8

I'm having trouble converting images to 1bit dithered images using GraphicsMagic. The converted images are to be used as input for a thermal printer.

I'm using the following command:

gm convert input.jpg -resize 384 -monochrome -dither out.bmp

The result is a 1bit dithered image, but the quality is different then e.g. a dithered image from GIMP, The GIMP (or resulting images from other programs) image looks slightly better.

Does anyone have tips to achieve the same results? (I have experimented with other GraphicsMagic options, but to no avail)

Original

ORIGINAL

GraphicsMagick

GM

GIMP

GIMP

Gunthar answered 11/1, 2016 at 19:22 Comment(2)
Can you show an example of the difference in "quality"? Quality can mean a lot of different things in this context.Boydboyden
Added some sample images ;)Gunthar
P
13

You can dither in a fashion closer to GIMP using this command:

convert scooter.png -resize 384 -dither FloydSteinberg -remap pattern:gray50 scooter_d.gif

enter image description here

By the way, you can get rather good results using an ordered dither like this:

convert scooter.png -colorspace gray -ordered-dither o8x8 result.gif

enter image description here

Kudos to Anthony Thyssen who wrote the excellent ImageMagick Usage pages - Quantisation with ImageMagick.

Prosper answered 12/1, 2016 at 10:3 Comment(2)
Nice! That looks more like it, I used GraphicsMagick, and it does not support the remap option (or i could not find it). So I switched to Imagemagick. Thanks for the help.Gunthar
Thanks for the two different methods; these are niceCassady

© 2022 - 2024 — McMap. All rights reserved.