Unix (osx) command line image processor? [closed]
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this questionI have a jpeg image of 400x400 px that i want to paste into a 960x640 image. Is there a command line image processor that I can use on OSX? Thanks!
Since you're on OS X, you can look into SIPS (scriptable image processing system) since it is installed by default. I'm not sure I fully understand what you're doing, but from your comments it looks like you're just trying to resize the image. If that's the case, have a look at the --resampleHeightWidth
, --padToHeightWidth
, and --cropToHeightWidth
options on the man page linked above.
For example, you might try sips -z 960 640 yourinputimage.jpeg
EDIT: Based on your comment -- no, you cannot do this with SIPS to my knowledge. As others have mentioned, your best bet is probably ImageMagick. Once installed, you can use the composite
command-line tool to do what you're asking. See this documentation.
If you want it on iPhone, then I'll suggest you to search or even build Image Magick for the iPhone.
It will allow you to resize images right from the command line.
There are command-line tools like ImageMagick, but you might find OSX's Automator to be easier to use.
精彩评论