Tuesday, 15 September 2015

ghostscript - How to resize/resample bitmap images within pdfs and maintain vector overlays -



ghostscript - How to resize/resample bitmap images within pdfs and maintain vector overlays -

my workflow follows:

i annotate bitmap images using inkscape vector elements (text, lines, etc.). export pdf inkscape , include in pdflatex source (includegraphics...).

somehow, don't want downscale bitmaps prior embedding in inkscape maintain svg files universal. on other hand, resulting pdfs after pdflatex unnecessary huge due images in total (ridiculous) resolution. unfortunately, pdf export of inkscape not back upwards downsampling of bitmaps right away (this is, however, discussed). tried utilize ghostscript cut down pdfs inkscape before running pdflatex. however, vector annotations rendered in process want avoid , question about.

i used ghostscript (found in different flavors nil worked):

gs -dnopause -dbatch -dsafer \ -sdevice=pdfwrite \ -dcompatibilitylevel=1.3 \ -dpdfsettings=/ebook \ -dembedallfonts=true \ -dsubsetfonts=true \ -dcolorimagedownsampletype=/bicubic \ -dcolorimageresolution=200 \ -dgrayimagedownsampletype=/bicubic \ -dgrayimageresolution=400 \ -dmonoimagedownsampletype=/bicubic \ -dmonoimageresolution=1200 \ -soutputfile=out.pdf \ in.pdf

so looking help/ideas image pdfs smaller yet still vector fine art in vector format.

1) don't utilize -dpdfsettings unless very sure do. in cas,e don't utilize it.

2) 200 ,400 , 1200 (!) dpi still high resolutions, seek still lower.

3) haven't set -ddownsamplecolorimages, -ddownsamplegrayimages or -ddownsamplemonoimages. changes downsampling type , resolution won't anything. (i know ridiculous, blame adobe settings have mimic....)

if can supply illustration file can test this, suspicion '3' problem. might want @ colorimagedownsamplethreshold (and gray/mono) switch.

pdf ghostscript vector-graphics inkscape resampling

No comments:

Post a Comment