Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating 1-bit PCX graphic files?

407 views
Skip to first unread message

Ilya Zakharevich

unread,
Dec 11, 2009, 12:17:13 PM12/11/09
to
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

Heiko Nitzsche

unread,
Dec 11, 2009, 2:46:18 PM12/11/09
to
> 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

Ilya Zakharevich

unread,
Dec 11, 2009, 5:02:52 PM12/11/09
to
On 2009-12-11, Heiko Nitzsche <hn-expire...@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

Ilya Zakharevich

unread,
Dec 11, 2009, 5:39:19 PM12/11/09
to

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

Heiko Nitzsche

unread,
Dec 11, 2009, 5:56:09 PM12/11/09
to
>> 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 new messages