1-bit bw pict file convert to jpeg

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
bananas2
Posts: 14
Joined: 2008-02-12T08:51:47-07:00

1-bit bw pict file convert to jpeg

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 1-bit bw pict file convert to jpeg

Post 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.
bananas2
Posts: 14
Joined: 2008-02-12T08:51:47-07:00

Re: 1-bit bw pict file convert to jpeg

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 1-bit bw pict file convert to jpeg

Post 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.
bananas2
Posts: 14
Joined: 2008-02-12T08:51:47-07:00

Re: 1-bit bw pict file convert to jpeg

Post by bananas2 »

@Anthony, pls give us some ideas :)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: 1-bit bw pict file convert to jpeg

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply