grayscale PDF to diffusion dithered bitmap

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
esmanske
Posts: 3
Joined: 2019-09-25T09:53:07-07:00
Authentication code: 1152

grayscale PDF to diffusion dithered bitmap

Post by esmanske »

Full disclosure I have NO IDEA what im doing. After looking through websites and lines of code to try and figure it out, i figured i would go to people that know more that i do.

can anyone take this line and make it download a bitmap that holds the gradient?

https://media.theoccasionsgroup.com/is/ ... ve,off,256

it currently returns a 50% threshold bitmap.

here is the original PDF made in Adobe Illustrator
https://media.theoccasionsgroup.com/is/ ... df?fmt=pdf

Thanks in advance for the help and sorry in advance if this make zero sense:)
Last edited by esmanske on 2019-09-25T10:27:22-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: grayscale PDF to diffusion dithered bitmap

Post by fmw42 »

The file is a TIFF created from a PDF. As it is, it is a binary (two color) image -- only white and black. There is no gradient. Perhaps in the original PDF there might have been. But when the image was converted to TIFF from PDF, it was binarized into two colors, black and white.

You should find the original PDF.
esmanske
Posts: 3
Joined: 2019-09-25T09:53:07-07:00
Authentication code: 1152

Re: grayscale PDF to diffusion dithered bitmap

Post by esmanske »

I added the original PDF to the post.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: grayscale PDF to diffusion dithered bitmap

Post by fmw42 »

What is your ImageMagick version and platform/OS. What was your exact command line?

The following works fine for me on IM 6.9.10.65 Q16 Mac OSX.

To TIFF:

Code: Select all

convert TOGDESIGNER_210072_1569340440320_A2.pdf TOGDESIGNER_210072_1569340440320_A2.tif
or

To PNG:

Code: Select all

convert TOGDESIGNER_210072_1569340440320_A2.pdf TOGDESIGNER_210072_1569340440320_A2.png
Your file is CMYK. You may want to convert to sRGB first.

Code: Select all

convert -colorspace sRGB TOGDESIGNER_210072_1569340440320_A2.pdf TOGDESIGNER_210072_1569340440320_A2.tif
If using ImageMagick 7, replace convert with magick.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: grayscale PDF to diffusion dithered bitmap

Post by fmw42 »

Note: to process PDF files, your ImageMagick must have Ghostscript installed. ImageMagick uses Ghostscript. If you have it installed, then check the version of it. Perhaps you need to upgrade. Also note that GS 9.26 and 9.27 reportedly have bugs. So upgrade to 9.23, 9.24 or 9.25.
esmanske
Posts: 3
Joined: 2019-09-25T09:53:07-07:00
Authentication code: 1152

Re: grayscale PDF to diffusion dithered bitmap

Post by esmanske »

the image needs to be 100% black which is why I need it to stay CMKY. Could you send me the tiff version get? If it is a grayscale image with white background it won't work. it needs to be a bitmap tiff

this is what i would like it to return. I changed this in Photoshop. I'm trying to automate this
This is the PDF
https://media.theoccasionsgroup.com/is/ ... df?fmt=pdf

so it returns this as a TIFF
https://media.theoccasionsgroup.com/is/ ... ve,off,256

the second image is being placed into an automated version of InDesign to colorize
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: grayscale PDF to diffusion dithered bitmap

Post by fmw42 »

What commands did you do in Photoshop?

The best I can do without further information about how processed your image is as follows:

Code: Select all

convert -colorspace sRGB TOGDESIGNER_210072_1569340440320_A2.pdf -background white -alpha background -alpha off -dither FloydSteinberg -remap bw.gif TOGDESIGNER_210072_1569340440320_A2_im.tif
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: grayscale PDF to diffusion dithered bitmap

Post by fmw42 »

I can get something similar by extracting a tiff from your PDF file. I used pdfimages, which you can get from the poplar tools. See https://www.google.com/url?sa=t&rct=j&q ... ofpK-Jg1ks

Code: Select all

pdfimages -tiff TOGDESIGNER_210072_1569433640402_A1_1.pdf result
Note, no suffix is put on the result name, since it is added automatically using the -tiff flag
Post Reply