Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #322

downsampling to a specific resolution with ghostscript

From Matteo Gamboz <gamboz@medialab.sissa.it>
Newsgroups comp.lang.postscript
Subject downsampling to a specific resolution with ghostscript
Date 2011-09-07 16:42 +0200
Organization Aioe.org NNTP Server
Message-ID <j47vs9$uac$2@speranza.aioe.org> (permalink)

Show all headers | View raw


Hi all,
    I have this problem: I need to downsample images in a pdf file to a 
resolution in the range 150-220.
Even if there is no bug in ghostscript, I cannot get images with 
resolutions between 221-299dpi down to my range.

Basically I tried with
gs -o out.pdf -sDEVICE=pdfwrite -dDownsampleColorImages \
-dColorImageResolution=150 x.pdf
and played a bit with the resolution, ColorImageDownsampleThreshold and 
ColorImageDownsampleType but without any luck

AFAICT, gs seems to downsample only to resolutions that are an integer 
factor of the original resolution (or something close to that).
For instance, for a image with original resolution of 300dpi, I can get 
down to 50, 60, 75, 100, 150.
For one with original resolution of 251 (a prime number), I can get down 
to 50 (where 50x5=250), 62 (where 62x4=248), 83, 125. But for any target 
resolution from 126 to 249 I always get 251 (i.e. no change).

Maybe what I need is more correctly called "resample".


Does anyone know any trick I could use here?

Thanks
m




P.S. I posted this also on gs-devel mailing list, but maybe here is more 
appropriate

Back to comp.lang.postscript | Previous | NextNext in thread | Find similar


Thread

downsampling to a specific resolution with ghostscript Matteo Gamboz <gamboz@medialab.sissa.it> - 2011-09-07 16:42 +0200
  Re: downsampling to a specific resolution with ghostscript Cem <cem@schoolsparks.com> - 2012-01-06 23:04 -0800

csiph-web