bundleid cn.alanhe.compress-gif category Self-Dev connections 07CE0A60-C3F9-4C27-BEF5-377D2865A9E3 destinationuid 73EACBF7-1B28-4095-84F9-9686EF64E096 modifiers 0 modifiersubtext vitoclose 0BC8DF28-40AD-4943-B85C-A1114C75A9A2 destinationuid 4A80E415-C55B-459A-8FF8-6372696BD8D8 modifiers 0 modifiersubtext vitoclose 117C083C-CACD-4FD5-9198-6B9FF3B66CF4 destinationuid 19447271-B75B-485D-98B1-F46B39B99B9E modifiers 0 modifiersubtext vitoclose 1583322E-6CC6-4140-A030-A17980C70E27 destinationuid 117C083C-CACD-4FD5-9198-6B9FF3B66CF4 modifiers 0 modifiersubtext vitoclose 19447271-B75B-485D-98B1-F46B39B99B9E 1D2B0594-5614-4057-96C7-D77E0ED863E4 destinationuid 19447271-B75B-485D-98B1-F46B39B99B9E modifiers 0 modifiersubtext vitoclose 36314461-8FEE-479B-97F5-C9EFC23E8329 destinationuid 1B258138-E893-4EB1-BBAF-0767B6496A9E modifiers 0 modifiersubtext vitoclose 401D924A-DF04-4FB7-BAE2-1D042EBAC660 destinationuid 52EB62D9-B694-490C-99F7-B16141A2550D modifiers 0 modifiersubtext vitoclose 4A80E415-C55B-459A-8FF8-6372696BD8D8 destinationuid 8A3CBA76-9DB4-41ED-A00D-E4F4638026C1 modifiers 0 modifiersubtext vitoclose 52EB62D9-B694-490C-99F7-B16141A2550D destinationuid C157D1E4-BF04-4FC9-AE51-AEF67C3A3ADD modifiers 0 modifiersubtext vitoclose 73EACBF7-1B28-4095-84F9-9686EF64E096 destinationuid 927D3D7C-7E7E-440E-8F66-BA7FFFC8A5A2 modifiers 0 modifiersubtext vitoclose 8A3CBA76-9DB4-41ED-A00D-E4F4638026C1 destinationuid 1583322E-6CC6-4140-A030-A17980C70E27 modifiers 0 modifiersubtext sourceoutputuid 7167E3C7-58D7-4F1D-8D45-9329BDA86695 vitoclose destinationuid B378C189-93C5-4183-9074-AC0A03C98F9B modifiers 0 modifiersubtext vitoclose 927D3D7C-7E7E-440E-8F66-BA7FFFC8A5A2 destinationuid F01B84E1-80CC-4B22-AC74-C5B75D5CC433 modifiers 0 modifiersubtext vitoclose B378C189-93C5-4183-9074-AC0A03C98F9B C157D1E4-BF04-4FC9-AE51-AEF67C3A3ADD destinationuid 36314461-8FEE-479B-97F5-C9EFC23E8329 modifiers 0 modifiersubtext sourceoutputuid 7167E3C7-58D7-4F1D-8D45-9329BDA86695 vitoclose destinationuid 69D9815D-9617-4900-86F5-6A004D56224F modifiers 0 modifiersubtext vitoclose C2D5D50F-9A62-44BD-9FE4-2B1B58236E6D destinationuid CCEFAB73-E689-4074-B0A6-DC872FE5A538 modifiers 0 modifiersubtext sourceoutputuid 28D175AB-E3A9-43AC-AF72-808F5EB943C2 vitoclose destinationuid DDE33C83-6DFB-4A39-9192-CD93B7930812 modifiers 0 modifiersubtext vitoclose CBD383F3-AEDA-4416-B5EC-E0A6984147D4 destinationuid 8A3CBA76-9DB4-41ED-A00D-E4F4638026C1 modifiers 0 modifiersubtext vitoclose EA2FEFE3-CA74-4BBD-9ABE-B4442B37E69B destinationuid C157D1E4-BF04-4FC9-AE51-AEF67C3A3ADD modifiers 0 modifiersubtext vitoclose F01B84E1-80CC-4B22-AC74-C5B75D5CC433 destinationuid C2D5D50F-9A62-44BD-9FE4-2B1B58236E6D modifiers 0 modifiersubtext vitoclose destinationuid C7FF401B-4E42-4D93-83E7-DFA7F6611D24 modifiers 0 modifiersubtext vitoclose createdby Alan He description Compress GIF, WebP, JPEG and PNG Size disabled name Compress objects config concurrently escaping 102 script full_path={query} pth=$( echo ${full_path%/*} ) d=`date +%F-%H%M%S` file_name="${full_path##*/}" file="${file_name%.*}" target="$pth/$file-opt.gif" /usr/local/bin/gifsicle -i $full_path -O3 --colors $colors --scale $scale -o $target echo $target scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 36314461-8FEE-479B-97F5-C9EFC23E8329 version 2 config lastpathcomponent onlyshowifquerypopulated removeextension text {query} title Compressed type alfred.workflow.output.notification uid 1B258138-E893-4EB1-BBAF-0767B6496A9E version 1 config argumenttype 2 keyword gif subtext Reduce GIF size text GIF Compress withspace type alfred.workflow.input.keyword uid 401D924A-DF04-4FB7-BAE2-1D042EBAC660 version 1 config concurrently escaping 68 script on run tell application "Finder" to set theItems to selection repeat with itemRef in theItems set myitem to POSIX path of (itemRef as string) end repeat -- it will store the last filename in selection return myitem end run scriptargtype 0 scriptfile type 6 type alfred.workflow.action.script uid 52EB62D9-B694-490C-99F7-B16141A2550D version 2 config conditions inputstring matchcasesensitive matchmode 4 matchstring \.gif$ outputlabel uid 7167E3C7-58D7-4F1D-8D45-9329BDA86695 elselabel else hideelse type alfred.workflow.utility.conditional uid C157D1E4-BF04-4FC9-AE51-AEF67C3A3ADD version 1 config acceptsmulti 0 filetypes com.compuserve.gif name GIF compress type alfred.workflow.trigger.action uid EA2FEFE3-CA74-4BBD-9ABE-B4442B37E69B version 1 config lastpathcomponent onlyshowifquerypopulated removeextension text title Please select a gif! type alfred.workflow.output.notification uid 69D9815D-9617-4900-86F5-6A004D56224F version 1 config lastpathcomponent onlyshowifquerypopulated removeextension text {query} title Compressed type alfred.workflow.output.notification uid 1D2B0594-5614-4057-96C7-D77E0ED863E4 version 1 config concurrently escaping 68 script on run tell application "Finder" to set theItems to selection repeat with itemRef in theItems set myitem to POSIX path of (itemRef as string) end repeat -- it will store the last filename in selection return myitem end run scriptargtype 0 scriptfile type 6 type alfred.workflow.action.script uid 4A80E415-C55B-459A-8FF8-6372696BD8D8 version 2 config argumenttype 2 keyword img subtext Reduce Image size, Support WebP, JPEG and PNG text Image Compress withspace type alfred.workflow.input.keyword uid 0BC8DF28-40AD-4943-B85C-A1114C75A9A2 version 1 config argument {query} passthroughargument variables filename {query} type alfred.workflow.utility.argument uid 1583322E-6CC6-4140-A030-A17980C70E27 version 1 config concurrently escaping 102 script query=$(echo {query} | sed -e 's/\r//g') curl --user api:$api_key --data-binary "@$query" "https://api.tinify.com/shrink" | /usr/local/bin/jq -r '.output.url' scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 117C083C-CACD-4FD5-9198-6B9FF3B66CF4 version 2 config conditions inputstring matchcasesensitive matchmode 4 matchstring \.(webp|jpe?g|png)$ outputlabel uid 7167E3C7-58D7-4F1D-8D45-9329BDA86695 elselabel else hideelse type alfred.workflow.utility.conditional uid 8A3CBA76-9DB4-41ED-A00D-E4F4638026C1 version 1 config acceptsmulti 0 filetypes org.webmproject.webp public.jpeg public.png name Image compress type alfred.workflow.trigger.action uid CBD383F3-AEDA-4416-B5EC-E0A6984147D4 version 1 config concurrently escaping 102 script full_path=$filename pth=$( echo ${full_path%/*} ) file_name="${full_path##*/}" file_extension="${full_path##*.}" file="${file_name%.*}" target="$pth/$file-opt.$file_extension" curl -o $target {query} echo {query} scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 19447271-B75B-485D-98B1-F46B39B99B9E version 2 config lastpathcomponent onlyshowifquerypopulated removeextension text WebP, JPEG and PNG title Please select a img! type alfred.workflow.output.notification uid B378C189-93C5-4183-9074-AC0A03C98F9B version 1 config lastpathcomponent onlyshowifquerypopulated removeextension text title Compressed type alfred.workflow.output.notification uid CCEFAB73-E689-4074-B0A6-DC872FE5A538 version 1 config argumenttrimmode 0 argumenttype 2 fixedorder items [{"title":"mov","arg":"mov"},{"title":"mp4","arg":"mp4"}] matchmode 0 runningsubtext subtext title withspace type alfred.workflow.input.listfilter uid 927D3D7C-7E7E-440E-8F66-BA7FFFC8A5A2 version 1 config acceptsmulti 0 filetypes com.apple.quicktime-movie public.mpeg-4 name Video compress type alfred.workflow.trigger.action uid 07CE0A60-C3F9-4C27-BEF5-377D2865A9E3 version 1 config concurrently escaping 102 script suffix={query} full_path=$filepath pth=$( echo ${full_path%/*} ) d=`date +%F-%H%M%S` file_name="${full_path##*/}" file="${file_name%.*}" target="$pth/$file-opt.$suffix" crf=$(echo "($scale * 51 + 0.5) / 1" | bc -l | xargs printf "%.0f") ffmpeg -i "$filepath" -c:v libx264 -crf $crf -c:a copy -loglevel error "$target" echo -n $? scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid F01B84E1-80CC-4B22-AC74-C5B75D5CC433 version 2 config conditions inputstring matchcasesensitive matchmode 0 matchstring 0 outputlabel uid 28D175AB-E3A9-43AC-AF72-808F5EB943C2 elselabel else hideelse type alfred.workflow.utility.conditional uid C2D5D50F-9A62-44BD-9FE4-2B1B58236E6D version 1 config argument passthroughargument variables filepath {query} type alfred.workflow.utility.argument uid 73EACBF7-1B28-4095-84F9-9686EF64E096 version 1 config lastpathcomponent onlyshowifquerypopulated removeextension text title Compressed fail type alfred.workflow.output.notification uid DDE33C83-6DFB-4A39-9192-CD93B7930812 version 1 config lastpathcomponent onlyshowifquerypopulated removeextension text just waitting for moment title Compressing type alfred.workflow.output.notification uid C7FF401B-4E42-4D93-83E7-DFA7F6611D24 version 1 readme > Compress your GIF/Mov/MP4, support scale to convert compress ratio ## requirement ### GIF `brew install gifsicle` ### Image `brew install jq` visit https://tinypng.com/developers, get your api key tinypng pricing ![https://i.imgur.com/NQTEs5s.jpg](https://i.imgur.com/NQTEs5s.jpg) ### Mov/Mp4 `brew install ffmpeg` uidata 07CE0A60-C3F9-4C27-BEF5-377D2865A9E3 xpos 55 ypos 880 0BC8DF28-40AD-4943-B85C-A1114C75A9A2 xpos 50 ypos 470 117C083C-CACD-4FD5-9198-6B9FF3B66CF4 note upload and compress xpos 715 ypos 510 1583322E-6CC6-4140-A030-A17980C70E27 xpos 595 ypos 510 19447271-B75B-485D-98B1-F46B39B99B9E note downlad xpos 1125 ypos 710 1B258138-E893-4EB1-BBAF-0767B6496A9E xpos 965 ypos 75 1D2B0594-5614-4057-96C7-D77E0ED863E4 xpos 935 ypos 435 36314461-8FEE-479B-97F5-C9EFC23E8329 xpos 715 ypos 65 401D924A-DF04-4FB7-BAE2-1D042EBAC660 xpos 45 ypos 90 4A80E415-C55B-459A-8FF8-6372696BD8D8 note get selection xpos 265 ypos 440 52EB62D9-B694-490C-99F7-B16141A2550D note get selection xpos 280 ypos 90 69D9815D-9617-4900-86F5-6A004D56224F xpos 700 ypos 320 73EACBF7-1B28-4095-84F9-9686EF64E096 xpos 255 ypos 905 8A3CBA76-9DB4-41ED-A00D-E4F4638026C1 xpos 490 ypos 635 927D3D7C-7E7E-440E-8F66-BA7FFFC8A5A2 xpos 380 ypos 875 B378C189-93C5-4183-9074-AC0A03C98F9B xpos 710 ypos 745 C157D1E4-BF04-4FC9-AE51-AEF67C3A3ADD xpos 495 ypos 250 C2D5D50F-9A62-44BD-9FE4-2B1B58236E6D xpos 860 ypos 895 C7FF401B-4E42-4D93-83E7-DFA7F6611D24 xpos 845 ypos 1060 CBD383F3-AEDA-4416-B5EC-E0A6984147D4 xpos 65 ypos 660 CCEFAB73-E689-4074-B0A6-DC872FE5A538 xpos 970 ypos 805 DDE33C83-6DFB-4A39-9192-CD93B7930812 xpos 975 ypos 935 EA2FEFE3-CA74-4BBD-9ABE-B4442B37E69B xpos 50 ypos 265 F01B84E1-80CC-4B22-AC74-C5B75D5CC433 xpos 675 ypos 885 userconfigurationconfig config default placeholder required trim description label TinyPNG API Key type textfield variable api_key config default 256 placeholder required trim description label Colors type textfield variable colors config default 0.4 placeholder required trim description 0-1 label Compress Ratio type textfield variable scale variablesdontexport version 3.0 webaddress https://github.com/alanhg/alfred-workflows/tree/master/compress-gif