首页 > 解决方案 > How do I set the new resolution of an image

问题描述

I am a segment of my script where I scale down an image from 1200 dpi to 300 dpi.

I am trying to do this:

repeat with i in input
    tell application "Image Events"
        launch
        set my_image to open i
        set resolution to {300,300}
        set color space to CMYK
        save my_image as TIFF

but resolution is read only????

How can I set the new resolution of an image?

标签: applescript

解决方案


我想你需要打电话sips给你设置它:

do shell script "sips -s dpiHeight 300 -s dpiWidth 300 " & my_image

推荐阅读