Page 1 of 1

1-bit bw pict file convert to jpeg

Posted: 2008-02-12T09:04:38-07:00
by bananas2
Water_lilies.pct is 1bpp pict file

http://bananas.at.tut.by/Water_lilies.pct

D:\Projects\fs\volume1\19292\1>identify -verbose Water_lilies.pct
Image: Water_lilies.pct
Format: PICT (Apple Macintosh QuickDraw/PICT)
Class: DirectClass
Geometry: 800x600+0+0
Type: Bilevel
Endianess: Undefined
Colorspace: Gray
Depth: 1-bit
Channel depth:
Gray: 1-bit
Channel statistics:
Gray:
Min: 1 (1)
Max: 1 (1)
Mean: 1 (1)
Standard deviation: 0 (0)
Histogram:
480000: (255,255,255) #FFFFFF white
Rendering intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 37.7813kb
Interlace: None
Background color: white
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Page geometry: 800x600+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Signature: 6d3f971515352d9e26114fb1cc5a87d6832b76f775e0683e3e504abc2dd9da6f
Profile-iptc: 18 bytes
Tainted: False
User time: 0.125u
Elapsed time: 0:01
Pixels per second: 3.66208mb
Version: ImageMagick 6.3.6 11/02/07 Q8 http://www.imagemagick.org

convert Water_lilies.pct Water_lilies.jpeg

creates white empty image. IM takes black as transparent color and convert it to white, so the whole image became white.

does Water_lilies.pct have transparency? or is this a bug?

Re: 1-bit bw pict file convert to jpeg

Posted: 2008-02-12T14:33:31-07:00
by fmw42
You have a very strange image. I can display it on my Mac in Preview and see your image (as .pct or PICT is a Mac format). But it has 3 gray shades - black, white and gray. So even though it is a binary image according to IM, it has a white background (which is all that IM will display), a gray matte and transparent set to black. Apparently IM does not understand how to display this with X11 as all I get is a white image.

I also tried to separate out the matte channel with

convert Water_lilies.pct -channel matte -negate -separate Water_lilies_matte.png

But all I got was a white image.

I also tried to convert transparent to black with

convert Water_lilies.pct -channel RGBA -fill black -opaque none Water_lilies2.png

But still got a white image.


So this is beyond me. Looks like it needs to be addressed by Anthony.

I will be curious to see what he says and comes up with.

Re: 1-bit bw pict file convert to jpeg

Posted: 2008-02-12T16:38:50-07:00
by bananas2
thanks for reply.

i also tried -opaque and -transparent options and got white image again.
i dont know much about .pict format, so its not clear for me is this file broken or valid?

Re: 1-bit bw pict file convert to jpeg

Posted: 2008-02-12T20:29:11-07:00
by fmw42
In my opinion it is valid as I can display it on my Mac in Preview and several other Mac-based image processing tools. But I think it is a very strange image and perhaps either IM cannot handle it or we do not know how to convert it in IM to a viewable format. Hopefully, Anthony or someone else will reply who knows more about how to handle this in IM.

Re: 1-bit bw pict file convert to jpeg

Posted: 2008-02-16T09:35:43-07:00
by bananas2
@Anthony, pls give us some ideas :)

Re: 1-bit bw pict file convert to jpeg

Posted: 2008-02-20T23:16:16-07:00
by anthony
From what I can see the IM pict reader is broken for this image.

Just a straight display produces just a white image.

And convert declares it has only one color, white...

Code: Select all

convert Water_lilies.pct -unique-colors txt:
# ImageMagick pixel enumeration: 1,1,65535,rgb
0,0: (65535,65535,65535) #FFFFFFFFFFFF white
As Fred has said that other image programs can read more that that, then this image should be posted on the IM Bugs forum as a Bug in the IM Pict coder.