Page 1 of 1

Detect vector or raster

Posted: 2008-02-07T17:28:09-07:00
by Jonzo
Hi, I'd like to treat my conversions differently depending on whether the image contains vector images or not. Is it possible to detect this? I've been googling and looking through documentation for aaages...

Thanks!

Re: Detect vector or raster

Posted: 2008-02-07T18:15:59-07:00
by anthony
That is just a selection based on image file format.

Re: Detect vector or raster

Posted: 2008-02-07T19:15:17-07:00
by Jonzo
What about things like pdf or eps that can be vector or raster? Or am I wrong in my understanding of format?

Re: Detect vector or raster

Posted: 2008-02-07T21:01:58-07:00
by anthony
Both of those formats are vector. Though they can have raster components.

I have been wanting a method of extracting the raster components of these formats (without modification) but so far without success.

Re: Detect vector or raster

Posted: 2008-02-07T21:30:48-07:00
by Jonzo
Thanks, I'll just assume that all pdf and eps files are vector then :-)

p.s.

My specific problem was related to extracting the pixel size of the images (through the identify command). It works fine when extracting the dimensions of a "raster" pdf, but when dealing with vector images it still returns a width and height... I don't know where it's getting it from (preview image?) but I'd be interested if you could shed some light on the situation :-)

Re: Detect vector or raster

Posted: 2008-02-10T19:08:44-07:00
by anthony
Not certain. It may be a function of how ghostscript is being called.

However please not that the actual number of pixels used in a vector'ed raster image is variable, depending on the current drawing 'density' or 'resolution'. that is it may not represent the actual number of pixels in the raster data that was used. (The pain, the pain!)

For example typically a single raster pixel, will use lots of pixels when the image is printed on a 600 pdi printer! The same goes for ghostscript 'rendered' documents, which is how converts such documents into a a raster image.