Page 2 of 2

Re: Conditional -negate pdf file

Posted: 2018-09-28T12:56:30-07:00
by Squashed
Having thought about it some more, I decided instead to use -black-threshold "%%[fx:mean<0.5?15:0]%%" before -level so that I could avoid using a variable. This way the background is set to black before inverting it to white.

One confusing issue, before conversion the background color was 22, but even with no operation imagemagick made that color 29. Any ideas why?

Re: Conditional -negate pdf file

Posted: 2018-09-28T12:58:44-07:00
by Squashed
Having thought about it some more, I decided instead to use -black-threshold "%%[fx:mean<0.5?15:0]%%" before -level so that I could avoid using a variable. This way the background is set to black before inverting it to white.

One confusing issue, before conversion the background color was 22, but even with no operation imagemagick made that color 29. Any ideas why?

Re: Conditional -negate pdf file

Posted: 2018-09-28T14:44:13-07:00
by snibgo
Squashed wrote:... the background color was 22...
What does that mean? Where did that information come from?

Re: Conditional -negate pdf file

Posted: 2018-09-28T14:54:16-07:00
by Squashed
I opened the pdf in photoshop and hovered over the background color, ie non-text area, and viewed the rgb values in the info window. They read r=22,g=22,b=22. After running magick input.pdf output.pdf, I examined output.pdf in the same way and read r=29,g=29,b=29. I just want to know where to set my black point threshold. 22/255 = 8.6%, 29/255 = 11.4%, so setting it at 15% should be safe. Initially I had it at 10% and there was no change in the background values, which confused me. But I just wondered why the difference?