Selecting PhotoCD size

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
sacha

Selecting PhotoCD size

Post by sacha »

A .pcd file (Kodak PhotoCD) potentially has a number of images in it, at different sizes:

192x128
384x256
768x512
1536x1024
3072x2048

By default when you load the PhotoCD file using MagickReadImage(), you get the 768 image. I need to select the largest available (3072 for my images), but don't know how.

I have the following program:

Code: Select all

def main () {
  local w = NewMagickWand()
  MagickReadImage(w, info("argv 1"))
  print(MagickGetImageFormat(w))
  print(MagickGetNumberImages(w))
  print(MagickGetImageWidth(w), "x", MagickGetImageHeight(w))
  DestroyMagickWand(w)
}
It produces the following output:

Code: Select all

PCD
1
768x512
Anyone know how to select something other than the 768?
sacha

Re: Selecting PhotoCD size

Post by sacha »

From a trawl through the source code, it turns out the answer is to specify the geometry before you load the file:

Code: Select all

MagickSetSize(w, 3072, 2048)
MagickReadImage(w, info("argv 1"))
I've verified that this does indeed load the high resolution image rather than upscaling a lower resolution image.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Selecting PhotoCD size

Post by anthony »

Added this to IM Examples, File Formats
http://www.imagemagick.org/Usage/#pcd
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply