On 01/03/21 13:48, Neil Bothwick wrote:
> On Mon, 1 Mar 2021 11:50:35 +0000, Wols Lists wrote:
> 
>> I've got a bunch of scans, let's assume they're text documents. And
>> they're rather big ... I want to email them.
>>
>> How on earth do I convert them to TRUE b&w documents? At the moment they
>> are jpegs that weigh in at 3MB, and I guess they're using about 5 bytes
>> to store all the colour, luminance, whatever, per pixel. But actually,
>> there's only ONE BIT of information there - whether that pixel is black
>> or white.
>>
>> I'm using imagemagick, but so far all my attempts to strip out the
>> surplus information have resulted in INcreasing the file size ???
>>
>> So basically, how do I save an image as "one bit per pixel" like you'd
>> think you'd send to a B&W printer?
> 
> $ convert input.jpg -threshold 50% output.png
> 
> should do it, you may need to play with the threshold setting. The file
> command reports the output file as being "1-bit grayscale".
> 
> You can also use -monochrome but that will produce a dithered image,
> that's probably not what you want judging by your description.
> 
> 
FINALLY!

Thanks, that worked! Okay, I also adjusted the dpi because the original
scan was 600 and I've reduced it to 300, but this has reduced the file
size from 3MB to 180KB.

Dunno why, but everything I was trying was INcreasing the file size :-(

And the png does make a massive difference - the same command with jpg
output is 1.7MB - so why is my scanner chucking out 800KB jpegs if I set
it correctly?

Cheers,
Wol

Reply via email to