Hello,
Please have a look at these files:
http://www.the-grue.de/source.tif
http://www.the-grue.de/result.tif
I'm using graphics magick to convert a bunch of scanned files. The files are
black text on white background, one bit tifs. gm identify says this:
gm identify -verbose source.tif
Image: source.tif
Format: TIFF (Tagged Image File Format)
Geometry: 2918x4205
Class: DirectClass
Type: bilevel
Depth: 1 bits-per-pixel component
Channel Depths:
Gray: 1 bits
Channel Statistics:
Gray:
Minimum: 0.00 (0.0000)
Maximum: 255.00 (1.0000)
Mean: 232.95 (0.9135)
Standard Deviation: 71.67 (0.2811)
Resolution: 157.48x157.48 pixels/centimeter
Filesize: 157.7K
Interlace: No
Orientation: Unknown
Background Color: white
Border Color: #DFDFDF
Matte Color: #BDBDBD
Page geometry: 2918x4205+0+0
Compose: Over
Dispose: Undefined
Iterations: 0
Compression: Zip
Document: source.tif
Comment: Image generated by GPL Ghostscript (device=pnmraw)
Software: GraphicsMagick 1.3.20 2014-08-16 Q8 http://www.GraphicsMagick.org/
Signature: df98437433973660a19c1d07daa1b1ee4b50f7ed4fd9d16bc7e0903268308dd2
Tainted: False
User Time: 0.090u
Elapsed Time: 0:01
Pixels Per Second: 130.0M
These scans all have different geometries. What I need is to put them onto a
page that has a fixed size, using a fixed border - think about a frame with a
fixed size where the scans are put into.
I have a script which does that just fine with tiffs that have a higher channel
depth. The main part of the script does this:
gm composite -compress LZW -geometry +0+118 -gravity North -resize 2244x3153
-units PixelsPerInch -density 300x300 source.tif
-size 2481x3508 xc:white result.tif
But when I run this, the result looks terrible: the background is black and the
text looks like some kind of edge-detecting filter has been used. That's the
output of gm identify:
gm identify -verbose result.tif
Image: result.tif
Format: TIFF (Tagged Image File Format)
Geometry: 2230x3153
Class: DirectClass
Type: grayscale
Depth: 8 bits-per-pixel component
Channel Depths:
Gray: 8 bits
Channel Statistics:
Gray:
Minimum: 0.00 (0.0000)
Maximum: 255.00 (1.0000)
Mean: 19.99 (0.0784)
Standard Deviation: 63.35 (0.2484)
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Resolution: 300x300 pixels/inch
Filesize: 2.9M
Interlace: No
Orientation: TopLeft
Background Color: white
Border Color: #DFDFDF
Matte Color: #BDBDBD
Page geometry: 2230x3153+0+0
Compose: Over
Dispose: Undefined
Iterations: 0
Compression: LZW
Signature: 01606cb2591b54508a6fbc054bcf985c47706fa8a97c356da57b4687827d5c06
Tainted: False
User Time: 0.160u
Elapsed Time: 0:01
Pixels Per Second: 41.9M
Oh, and by the way: it's not correctly framed, either :s
Could you please help me find out what I'm making wrong? My "frame-page" script
is working find, just not for these 1 bit images... (I think).
cu
--
Markus Grunwald
https://www.the-grue.de
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.