PCX without RLE (uncompressed)

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
giner

PCX without RLE (uncompressed)

Post by giner »

It's not possible to convert bmp to pcx without RLE compression

Code: Select all

$ convert test.bmp test.pcx; file test.pcx
test.pcx: PCX ver. 3.0 image data bounding box [0, 0] - [590, 117], 8-bit colour, 72 x 72 dpi, RLE compressed
$ convert -compress none test.bmp test.pcx; file test.pcx
test.pcx: PCX ver. 3.0 image data bounding box [0, 0] - [590, 117], 8-bit colour, 72 x 72 dpi, RLE compressed
$ convert +compress test.bmp test.pcx; file test.pcx
test.pcx: PCX ver. 3.0 image data bounding box [0, 0] - [590, 117], 8-bit colour, 72 x 72 dpi, RLE compressed
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PCX without RLE (uncompressed)

Post by fmw42 »

try

convert image.pcx -compress none image.bmp

see http://www.imagemagick.org/Usage/basics/#cmdline

Don't know if that will help, but it is the more correct syntax.
giner

Re: PCX without RLE (uncompressed)

Post by giner »

fmw42 wrote:try

convert image.pcx -compress none image.bmp

see http://www.imagemagick.org/Usage/basics/#cmdline

Don't know if that will help, but it is the more correct syntax.
Do you mean convert image.bmp -compress none image.pcx? It produces the same result.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PCX without RLE (uncompressed)

Post by fmw42 »

Do you mean convert image.bmp -compress none image.pcx? It produces the same result.
Sorry I had it backwards. But I am not a Windows expert so know little about Windows file formats. I am on a Mac. You my need help from a windows expert or the IM folks.
giner

Re: PCX without RLE (uncompressed)

Post by giner »

fmw42 wrote:
Do you mean convert image.bmp -compress none image.pcx? It produces the same result.
Sorry I had it backwards. But I am not a Windows expert so know little about Windows file formats. I am on a Mac. You my need help from a windows expert or the IM folks.
Windows? I'm not a windows user :)
Thanks for helping. Anyway I think this is a bug.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PCX without RLE (uncompressed)

Post by Drarakel »

The RLE compression is hardcoded (in pcx.c). I wouldn't call this a bug, as it's the intended behaviour in ImageMagick (and changing this would require a rewrite of some parts in the concerning method). I think, that's similar to GIF - that format also can't be saved without compression anymore in IM.
But I agree that it would be preferable if one could change these things at the commandline.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: PCX without RLE (uncompressed)

Post by el_supremo »

The PCX coder always writes the image with RLE compression.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PCX without RLE (uncompressed)

Post by fmw42 »

el_supremo wrote:The PCX coder always writes the image with RLE compression.

Pete
Pete,

That was my thought also, but according to http://www.fileformat.info/format/pcx/egff.htm, uncompressed seems to be permitted even if the IM coder does not permit it or is IM using some delegate for that?

Fred
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PCX without RLE (uncompressed)

Post by Drarakel »

As far as I can see, it's all in coders/pcx.c (including the compression, which gets done in the PCXWritePixels method).
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: PCX without RLE (uncompressed)

Post by el_supremo »

The IM coder writes the file, there's no delegate.
This file http://www.fileformat.info/format/pcx/egff.htm says:

Code: Select all

PCX files, however, always contain encoded image data, and currently the only valid value for the encoding field is 1.
This file http://www.qzx.com/pc-gpe/pcx.txt, which is supposed to be ZSoft's documentation of the PCX format, only talks about the file being encoded. It does not explicitly say anywhere that an uncompressed file is an option.
However, I modified my version of IM so that the coder will write an uncompressed PCX image and converted the rose: image to uncompressed rose.pcx. IrfanView and XnView can display the file but Paint Shop Pro can't.
@Magick: Let me know if you want my code to allow uncompressed PCX.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PCX without RLE (uncompressed)

Post by fmw42 »

Pete,

All I looked at was the table at the top of the file referenced above where it says:

Compression RLE, uncompressed

Fred

However, it is likely that Magick will take your code and allow IM to make uncompressed PCX files.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PCX without RLE (uncompressed)

Post by magick »

We can reproduce the problem you reported and have a patch in ImageMagick 6.6.4-0 to support PCX compression. Thanks.
giner

Re: PCX without RLE (uncompressed)

Post by giner »

Thank you very much for the quick fix!

Stas
Post Reply