From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 022711382C5 for ; Mon, 1 Mar 2021 12:11:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5334FE0993; Mon, 1 Mar 2021 12:11:38 +0000 (UTC) Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 03938E0959 for ; Mon, 1 Mar 2021 12:11:37 +0000 (UTC) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lGhOi-000420-Hg for gentoo-user@lists.gentoo.org; Mon, 01 Mar 2021 13:11:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: (Nuno Silva) Subject: [gentoo-user] Re: [OT] Saving an image as black and white Date: Mon, 01 Mar 2021 12:11:30 +0000 Message-ID: References: <603CD50B.9080303@youngman.org.uk> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Archives-Salt: dced9e70-d0d1-4354-adfa-6d66b926ea3f X-Archives-Hash: 52c9805f19b0a35dc94038d9e24dcb32 On 2021-03-01, 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? > > Even at 300dpi, I make that 300*300/8 ~= 10KB/in^2 or 800KB of > uncompressed info for a page of A4, not 3MB. > > Cheers, > Wol Somebody else might have a better suggestion, or perhaps a better understanding of the JPEG format and of what needs to be tuned, but, for example: convert origin.jpg -threshold 70% -monochrome result.jpg (And adjust the "-threshold percent" if needed. It might be that you don't need thresholding at all, but if you do, it apparently must go before "-monochrome".) (Depending on the receiving end, you could also explore other formats. Here, if the scanned document can be stored in monochrome, I usually use djvu.) -- Nuno Silva