Print

Print


Hi Bryan,

On 18 March 2011 14:03, Bryan Tong Minh <[log in to unmask]> wrote:
> I have problems with png images that are not in RGBA format, but are greyscale or pallete based. If I try to process such an image with vips, I get a fully black image.
>
> I tried with http://upload.wikimedia.org/wikipedia/commons/6/6f/Encyclopedie_volume_3-320.png

It's working, but it sets pixels to 0 or 1 for black and white. When
you shrink, these tiny differences get smoothed out. If you load the
image in nip2 you can use the display control bar to see the detail.

I'll add something to make the png reader set pixels to 0 or 255 for
1-bit images, but in the meantime, you can do:

vips im_png2vips Encyclopedie_volume_3-320.png t1.v
vips im_notequalconst t1.v t2.v 0
vips im_resize_linear t2.v thumb.png 365 492

ie. set pixels which are not equal to zero to 255.

Thanks for the report,

John