« [sips]画像のパディング padToHeightWidth padColor | トップページ | [sips]画像のCROP »

[sips]画像の操作 rotate flip horizontal flip vertical

例文
rotate
/usr/bin/sips "/System/Library/Desktop Pictures/Monterey Graphic.heic" --rotate 45 --setProperty format png -o ~/Desktop/rotate.png

flip horizontal
/usr/bin/sips "/System/Library/Desktop Pictures/Monterey Graphic.heic" --flip horizontal --setProperty format png -o ~/Desktop/horizontal.png

flip vertical
/usr/bin/sips "/System/Library/Desktop Pictures/Monterey Graphic.heic" --flip vertical --setProperty format png -o ~/Desktop/vertical.png



#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"
use scripting additions

set aliasLocationPath to (path to desktop pictures folder from system domain)
set aliasImageFilePath to (choose file of type {"public.image", "public.tiff", "public.png", "public.jpeg", "com.adobe.photoshop-image", "public.heic"} with prompt "ファイルを選んで" default location aliasLocationPath without invisibles, showing package contents and multiple selections allowed)

set theImageFilePath to POSIX path of aliasImageFilePath as text


set numWidthPx to 1280 as number
set numHeightPx to 720 as number

####
set theCommandText to ("/usr/bin/sips \"" & theImageFilePath & "\" --rotate 45 --setProperty format png -o ~/Desktop/rotate.png") as text
log "theCommandText:" & theCommandText
do shell script theCommandText

set theCommandText to ("/usr/bin/sips \"" & theImageFilePath & "\" --flip horizontal --setProperty format png -o ~/Desktop/horizontal.png") as text
log "theCommandText:" & theCommandText
do shell script theCommandText

set theCommandText to ("/usr/bin/sips \"" & theImageFilePath & "\" --flip vertical --setProperty format png -o ~/Desktop/vertical.png") as text
log "theCommandText:" & theCommandText
do shell script theCommandText


return

|

« [sips]画像のパディング padToHeightWidth padColor | トップページ | [sips]画像のCROP »

sips」カテゴリの記事