Creating 1-bit PCX graphic files?

  • Follow


I got a round tuit to start doing graphic includes in emTeX.  The only
problem now is that I need to convert graphic in other (=more
portable) format to 1-bit PCX files (other formats supported by
pmView, such as 1-bit BMP, do not show right).

But - Image Magick ignores `-depth 1' when writing to PCX.  Are there
any other automated conversion tools which can create 1-bit PCX?

Thanks,
Ilya
0
Reply Ilya 12/11/2009 5:17:13 PM

> But - Image Magick ignores `-depth 1' when writing to PCX.  Are there
> any other automated conversion tools which can create 1-bit PCX?

Can't PMView also write 1bit PCX bitmaps?

Anyway, you may want to try with GBM tool gbmbpp.
It is included in the WPI package or gbmos2_164_bin.zip.
Get it from Hobbes or from here: http://heikon.home.tlink.de/

Convert to 1bit Black/White by truncating palette:
gbmbpp -m bw src.bmp dst.pcx

Or with Error Diffusion algorithm:
gbmbpp -m bw -e src.bmp dst.pcx

0
Reply Heiko 12/11/2009 7:46:18 PM


On 2009-12-11, Heiko Nitzsche <hn-expires-24feb10@arcor.de> wrote:
>> But - Image Magick ignores `-depth 1' when writing to PCX.  Are there
>> any other automated conversion tools which can create 1-bit PCX?

> Can't PMView also write 1bit PCX bitmaps?

Most probably.  Is it scriptable?

> Convert to 1bit Black/White by truncating palette:
> gbmbpp -m bw src.bmp dst.pcx

This works:

  convert signature.png -resize 200% -blur 0x4 -depth 1 signature2b.pcx
  gbmbpp -m bw signature2b.pcx signature2b-1bit.pcx

It would be nice if one could do it without an intermediate file.  Can
gbmbpp read from pipe?  (Cannot deduce this from its help message...)

Thanks,
Ilya
0
Reply Ilya 12/11/2009 10:02:52 PM

On 2009-12-11, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> I got a round tuit to start doing graphic includes in emTeX.  The only
> problem now is that I need to convert graphic in other (=more
> portable) format to 1-bit PCX files (other formats supported by
> pmView, such as 1-bit BMP, do not show right).
>
> But - Image Magick ignores `-depth 1' when writing to PCX.  Are there
> any other automated conversion tools which can create 1-bit PCX?

To answer my own question: apparently, Image Magick reacts in some
undocumented way to combinations of -depth, -color, -type flags.  It
looks like at least 2 of possible combination DO produce B/W PCX:

   -depth 1 -colors 2
   -depth 1 -colors 2 -type Bilevel

(although the filesize of output is slightly larger than with gbmbpp...).

Yours,
Ilya
0
Reply Ilya 12/11/2009 10:39:19 PM

>> Can't PMView also write 1bit PCX bitmaps?
>
> Most probably.  Is it scriptable?

The Pro version has built-in batch support.

>    convert signature.png -resize 200% -blur 0x4 -depth 1 signature2b.pcx
>    gbmbpp -m bw signature2b.pcx signature2b-1bit.pcx
>
> It would be nice if one could do it without an intermediate file.  Can
> gbmbpp read from pipe?  (Cannot deduce this from its help message...)

No. Some decoders need random access to the complete bitmap data.
Thus the full pipe data would need to be copied initially which
might lead to an early out-of-memory for big images.

You could use a RAM drive for the intermediate files.
That's what I do.
0
Reply Heiko 12/11/2009 10:56:09 PM

4 Replies
862 Views

(page loaded in 0.05 seconds)

Similiar Articles:













7/22/2012 10:08:18 AM


Reply: