Re: Difficulty Scaling an Image
Re: Difficulty Scaling an Image
- Subject: Re: Difficulty Scaling an Image
- From: Stan Cleveland <email@hidden>
- Date: Tue, 28 Jul 2009 16:10:21 -0700
- Thread-topic: Difficulty Scaling an Image
On 7/28/09 1:29 PM, "Jon Rosen" wrote:
> I am trying to convert a PDF to a JPEG using Image Events so that the
> resulting JPEG has a resolution of 300 PPI. When I scale by a factor
> of 2, I end up with twice as many pixels than I do when I don't use
> the command, but the image displays at 150 PPI regardless of whether I
> scale it or not. I couldn't find a way to directly specify the
> resolution of the final image.
>
> My ultimate goal is to convert the PDF to a JPEG (with a resolution of
> 300 PPI) and to embed a color profile. I'm able to embed the profile
> by scripting ColorSync, but would like to know if it's possible to do
> the conversion and embed the profile within ColorSync itself, without
> having to use both Image Events and Color Sync.
Hi Jon,
Sorry to say, the 'resolution' property of an 'image' is read-only in Image
Events. It can't be changed.
If you're ambitious, one workaround would make use of Apple's Python
bindings for Quartz 2d. There's a useful Python example script in Developer
Tools. The exact path is:
/Developer/Examples/Quartz/Python/ps-to-cmyk.py
Using that script as a foundation [and some Googling re Quartz], you should
be able to put together some code that allows control of scaling,
resolution, cropping, translation, and rotation, not to mention color space
conversion. The input file could be set up to be PostScript, EPS, or PDF.
The output file format would be TIFF, which can be converted to JPEG using
the 'save as JPEG' command in Image Events.
If you get stuck, let me know off-list and I'll try to help you get going
again.
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden