Search found 72 matches

by muccigrosso
2018-02-17T12:43:58-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 13270

Re: Convert 2-bit to png after deskew has odd results

I believe that the reason for the results you get is that JPG is a lossy compressed format and does not support a true binary format. Due to the block-wise compression, it changes your values from two values to many grayscale values. Thus the JPG result will be 8-bit grayscale. Whereas the PNG comp...
by muccigrosso
2018-02-17T11:44:19-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 13270

Re: Convert 2-bit to png after deskew has odd results

fmw42 wrote:
2018-02-17T10:58:45-07:00
Can you post a link to your PGM 1-bit image, so we can examine it and test with it?
I did, above.
by muccigrosso
2018-02-17T10:53:18-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 13270

Re: Convert 2-bit to png after deskew has odd results

Thanks.

Do I have this right: because jpeg is an 8-bit format, the image automatically retains the grays, while png doesn't have to be 8-bit, and IM will keep the depth the same as the input file unless otherwise instructed?

PS Is there a formal way to suggest changes to the Usage docs?
by muccigrosso
2018-02-16T11:18:02-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 13270

Re: Convert 2-bit to png after deskew has odd results

Why does the deskewed pgm look OK with show: then? Because the small bit depth (2) is used when writing PNG, not when writing to "show:". To cure the problem, use "+depth" to get the full depth of the Q-number, or "-depth 8" or 16 or whatever. Thanks. Is the +depth option documented somewhere? I'd ...
by muccigrosso
2018-02-16T11:13:53-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 13270

Re: Convert 2-bit to png after deskew has odd results

MacOS 10.13.3 ImageMagick 7.0.7-22 Q16 x86_64 2018-01-23 Commands are: convert -deskew 40% test.pgm test_deskew.png convert -deskew 40% test.pgm test_deskew.jpg convert -deskew 40% -depth 8 test.pgm test_depth.png convert -deskew 40% test.pgm show: Files are here: https://www.dropbox.com/s/ecuuyke92...
by muccigrosso
2018-02-16T10:45:50-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 13270

Convert 2-bit to png after deskew has odd results

I've got an image in pgm format which identify says is "1-bit Bilevel Gray". If I convert it directly to png, it's fine. identify reports the png as "8-bit Gray 2c". Looks the same, of course. Now, if I "-deskew 40%" that image, the png is still "8-bit Gray 2c", but clearly a bunch of the pixels hav...
by muccigrosso
2017-12-01T15:09:01-07:00
Forum: Users
Topic: Programmatically distinguish background gray
Replies: 4
Views: 3017

Re: Programmatically distinguish background gray

Yep, I know that script. :-)

Part of this is me trying to work with IM.
by muccigrosso
2017-12-01T12:10:26-07:00
Forum: Users
Topic: Programmatically distinguish background gray
Replies: 4
Views: 3017

Re: Programmatically distinguish background gray

I'm not a fan of the black/white result of -lat. I was hoping for a more algorithmic way to decide whether or not to do anything.

I'll save the next images this happens with.
by muccigrosso
2017-12-01T09:17:56-07:00
Forum: Users
Topic: Programmatically distinguish background gray
Replies: 4
Views: 3017

Programmatically distinguish background gray

I'm using IM to clean up some scanned grayscale pages from a text. Right now I clean up the background when there's some poor scanning artifacts like shadows near a book spine by doing a contrast stretch of 5%,90%. This works well _except_ when the page doesn't really need the cleanup. Then the stre...
by muccigrosso
2017-11-30T17:20:54-07:00
Forum: Users
Topic: JBIG2DECODE in pdf
Replies: 3
Views: 4694

Re: JBIG2DECODE in pdf

I'm trying to do this same thing. identify says "identify: no decode delegate for this image format `JBG2' @ error/constitute.c/ReadImage/509."
by muccigrosso
2017-10-03T14:04:02-07:00
Forum: Users
Topic: chop with percentage affects other dimension
Replies: 3
Views: 3989

Re: chop with percentage affects other dimension

What version of IM? Please ALWAYS state the version of IM. I can't find the thread, but a change was made recently, so that when a "%" was used in geometry, any result of zero was changed to one. This was to prevent "-resize 1%" etc from failing by trying to create an image of zero pixels. I suspec...
by muccigrosso
2017-10-03T11:19:52-07:00
Forum: Users
Topic: chop with percentage affects other dimension
Replies: 3
Views: 3989

chop with percentage affects other dimension

If I use -chop with a percentage in only one dimension, the second dimension loses a pixel too. For example (and here I'm chopping the width, but the results are the same if I use the height): convert -format "%w x %h" rose: info: yields: 70 x 46 convert -format "%w x %h" -gravity east -chop 1x0 ros...