Gentoo Archives: gentoo-user

From: Frank Steinmetzger <Warp_7@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Saving an image as black and white
Date: Thu, 04 Mar 2021 20:04:12
Message-Id: YEE9Jc3JA4YDAA2e@kern
In Reply to: Re: [gentoo-user] [OT] Saving an image as black and white by Wols Lists
1 Am Mon, Mar 01, 2021 at 03:54:12PM +0000 schrieb Wols Lists:
2
3 > >> So basically, how do I save an image as "one bit per pixel" like you'd
4 > >> think you'd send to a B&W printer?
5 > >
6 > > $ convert input.jpg -threshold 50% output.png
7 > >
8 > > should do it, you may need to play with the threshold setting. The file
9 > > command reports the output file as being "1-bit grayscale".
10 > >
11 > > You can also use -monochrome but that will produce a dithered image,
12 > > that's probably not what you want judging by your description.
13 > >
14 > >
15 > FINALLY!
16 >
17 > Thanks, that worked! Okay, I also adjusted the dpi because the original
18 > scan was 600 and I've reduced it to 300, but this has reduced the file
19 > size from 3MB to 180KB.
20
21 Also note: DPI is just a factor that is stored in the image’s metadata. What
22 produces the actual filesize are the pixels. DPI is used to “convert”
23 between the physical size of a hypothetical print (i.e. sheet of paper) and
24 the number of pixel required for a certain density (and thus, quality).
25
26 As far as I know, jpeg does not have a special “grayscale mode”. You may
27 have reduced the information of the image by making all three colour
28 channels equal to one another, but jpeg still encodes the data as if were a
29 colour image. That’s why png is the much better option in this case.
30
31 --
32 Gruß | Greetings | Qapla’
33 Please do not share anything from, with or about me on any social network.
34
35 UNIX is not user-unfriendly.
36 It just expects the user to be a little more computer-friendly.

Attachments

File name MIME type
signature.asc application/pgp-signature