Search found 64 matches

by muccigrosso
2018-02-18T23:18:21-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

Your first command with -deskew does not add any new colors. They are just black and white. PGM is a linear gray whereas PNG is non-linear. That is why you see some changes in the results. But no new colors are added, just blacks and whites. There is no blurring. OK, let's blur the file instead of ...
by muccigrosso
2018-02-18T22:53:58-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

I'll just make a point about this: ... but doesn't what you do here force the conversion to 1-bit after the resize vs mine which does the depth reduction before resizing? "-depth 1" doesn't change any data, it doesn't reduce the data to 1 bit. It is a setting that is used when writing some output f...
by muccigrosso
2018-02-18T15:22:15-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

1) convert test.pgm -deskew 40% test.png results in 16/1-bit There were no increase in the number of colors in the output that would warrant an increase in depth. So IM keeps the depth. Well, this is the crux of the question. Yes, the resultant png here still has two colors, but the deskewed image ...
by muccigrosso
2018-02-18T13:37:39-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

Please write your questions with respect to commands that you feel are not working as we discussed above. Imagemgick will preserve bit depth if you do not add more colors than that bit depth allows and the output format supports that. We showed that the number of colors increases to 644, you get ei...
by muccigrosso
2018-02-18T11:33:24-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

So is there a question? Well, yeah, a few. :) I for one don't quite have clarity on this. In particular, why doesn't using standard in/out not preserve the bit-depth of the intermediate image? If that's by design, is it noted somewhere? Also, as you wrote: The point is, if you create more colors th...
by muccigrosso
2018-02-17T22:33:24-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

On Q16, with TIFF, the results are different. convert xc: xc:black +append t.tif identify -verbose says 16/1-bit (2 colors) but convert t.tif -resize 1000x1! t2.tif identify -verbose 16-bit grayscale with 644 colors. So I think the resulting bit depth and colors depends upon the output format. The ...
by muccigrosso
2018-02-17T22:18:24-07:00
Forum: Users
Topic: Convert 2-bit to png after deskew has odd results
Replies: 29
Views: 11478

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

The point is, if you create more colors than your input bit-depth and the output format supports it, you will get a higher bit depth result with more colors. OK, but png certainly supports more than 1 bit of color, yet the result of the deskew operation on my file was a 2-color png, unless I explic...
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: 11478

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: 11478

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: 11478

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: 11478

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: 11478

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: 11478

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: 2626

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: 2626

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.