Mobile app version of vmapp.org
Login or Join
Ravi4787994

: How can I save an image as a 2-bit PNG. any ideas? Im looking to save an icon as a 2-bit PNG or BMP, any ideas? The lowest option in photoshop is 4-bit. My icons are 4-levels grayscale

@Ravi4787994

Posted in: #Grayscale #Png

Im looking to save an icon as a 2-bit PNG or BMP, any ideas? The lowest option in photoshop is 4-bit.

My icons are 4-levels grayscale and must be saved as a 2-bit image. Is there a trick or a converter or something? I created these icons in both vector and pixel format using illustrator and photoshop, the tricky part now is giving the developers a 2-bit image file.

Any suggestions are greatly appreciated.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Ravi4787994

3 Comments

Sorted by latest first Latest Oldest Best

 

@Merenda852

If your editor does not natively support saving as indexed PNG, you will have to perform a destructive (lossy) operation, called "quantizing". Gimp isn't exactly lightweight and I have never gotten ImageMagick to do that properly, so I used a tool, called pngquant. It can reduce the image to palette with desirable number of colors, up to 2-bit, with or without added antialiasing. It has full alpha support.

Note, that images with lots of details (lines with non-integer width, lines thiner than 1px, fine curves) may not be represented with 2-bit palette without extreme quality loss, so experiment with colors count if you are not satisfied with result.

Also note, that some editors (Inkscape by default, Illustrator with some settings) won't pixel-align image elements, so quantizing will be less efficient due to the way multiple pixels are used for representing single "original" image pixel. If the image is sufficiently small, manually realigning lines to pixel boundaries may greatly improve the quality of result.

EDIT: I have got ImageMagick to work as well. Unfortunately, results of quantizing are very bad, compared to pngquant. There is an extra color in palette (e.g. requesting 8 colors produces png with 9 colors); images have severe artifacts, compared to same images, processed by pngquant. 2-bit images, produced by ImageMagick, are completely unusable.

All of above was observable with antialiasing and without.

10% popularity Vote Up Vote Down


 

@Debbie163

If you're using Adobe Photoshop you can simply press Ctrl + Shift + Alt + S to open the "Save for Web..."-Dialogue

Once you're there you just need to click at the top on the PNG-preset and change the amont of colors to "2". If they dont already appear as plain black and plain white you can set them manually.

There's also a filter available in Photoshop that lets you create exactly this effect.
The good thing about the filter is, that you can decide where exactly the white/black border is

10% popularity Vote Up Vote Down


 

@Eichhorn212

You might want to check out ImageMagick " software suite to create, edit, compose, or convert bitmap images."

Based on the conversion options, looks like you'd be able to try
convert image.png -depth 2

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme