raguay.customct Posted April 25, 2013 Share Posted April 25, 2013 Hi, I just updated my workflow for compressing images and converting image types. I also noticed that I had not mentioned it in these forums. You can download it at my Git Hub account: https://github.com/raguay/MyAlfred 'ci' is used to convert images to a smaller size and flatten them (remove alpha). The 'Convert Image Directory' directory action will also perform the same action on a directory of images. You currently have to change the script to get a different scale size. 'jpg-png' will convert from jpg format into png format. 'png-jpg' will convert from png format into jpg format. This workflow is heavy due to having the complete ImageMagick library. If you already have that library, you can change the scripts to use it and delete the library from the workflow. There is a lot of possibilities for this workflow. If you have a particular need, let me know and I will add or adopt to it. This workflow is AlleyOOP compliant. Link to comment
69wpm Posted April 25, 2013 Share Posted April 25, 2013 This workflow doesn't work for me, it creates the "tmp" folder and that's it. I get a notification but the image is neither compressed nor converted. Link to comment
raguay.customct Posted April 25, 2013 Author Share Posted April 25, 2013 Okay, which function were you using? If the 'ci' command or the 'Convert Image Directory' command? If these commands, did you set the extension first? What was the type of image you started with? Currently, the 'ci' and the 'Convert Image Directory' commands will scale it down to 930x? where the height will depend on the original image. You have to change the script manually to get a different resulting size. These commands I use for a specific project, so are not generic at all. But, I do plan on expanding it if people are interested. Link to comment
69wpm Posted April 25, 2013 Share Posted April 25, 2013 I used the "ci" command and set the extension to jpg first. The images are quite big, about 4000px in width so the scaling should not be a problem. Link to comment
raguay.customct Posted April 25, 2013 Author Share Posted April 25, 2013 I just pushed a fix for spaces being in the name. I always work with files without spaces, so I did not test that condition at all. If you still have a problem, see if your path to the file has a directory with spaces or not. Maybe that is the issue. Also, what type of file is it originally? Not sure if ImageMagick library handles all file type. I have only tested with png and jpg. Link to comment
69wpm Posted April 25, 2013 Share Posted April 25, 2013 (edited) I put the test-image file in "Downloads", so there are no spaces in the path. Now, the updated workflow does output an image, but it's not resized. This is the image I used. Also jpg to png does still not work. Edited April 25, 2013 by 69wpm Link to comment
raguay.customct Posted April 25, 2013 Author Share Posted April 25, 2013 I just pushed another fix. It now works on my system with your test file, but it takes at least 5 minutes! That is a big picture. Sorry, I did not look at the two converter routines since you did not mention them, but they had the spaces in name problem. The "png-jpg" and "jpg-png" commands now work fine on your test image. Give this new version, 1.4, a try and see. Thanks for your feedback. You should be able to update it by Alley-OOP. Link to comment
lmartins Posted April 25, 2013 Share Posted April 25, 2013 Can't download the Compress Imagem from github, maybe something went wrong with the latest update. Thanks. Link to comment
raguay.customct Posted April 25, 2013 Author Share Posted April 25, 2013 Sorry, with the full ImageMagick library, it is too big for github to download just that file. If you do a zip download of the full directory, you will get it okay. Sorry, I am fairly new to GitHub (two months). Link to comment
Tyler Eich Posted April 26, 2013 Share Posted April 26, 2013 Hi, I just updated my workflow for compressing images and converting image types. I also noticed that I had not mentioned it in these forums. You can download it at my Git Hub account: https://github.com/raguay/MyAlfred 'ci' is used to convert images to a smaller size and flatten them (remove alpha). The 'Convert Image Directory' directory action will also perform the same action on a directory of images. You currently have to change the script to get a different scale size. 'jpg-png' will convert from jpg format into png format. 'png-jpg' will convert from png format into jpg format. This workflow is heavy due to having the complete ImageMagick library. If you already have that library, you can change the scripts to use it and delete the library from the workflow. There is a lot of possibilities for this workflow. If you have a particular need, let me know and I will add or adopt to it. This workflow is AlleyOOP compliant. Have you considered using the 'sips' command line tool bundled with OS X? It can: Convert jpeg, tiff, png, gif, jp2, pict, bmp, qtif, psd, sgi, and tga to/from each other Constrain size (reduce width and/or height while maintaining aspect ratio) Flip Rotate Crop Pad (with or without a specified color) Since the workflow does not really need all the power of ImageMagick, it might be better to use a tool included with OS X. It would reduce the weight tremendously. Cheers Link to comment
raguay.customct Posted April 26, 2013 Author Share Posted April 26, 2013 Have you considered using the 'sips' command line tool bundled with OS X? It can: Convert jpeg, tiff, png, gif, jp2, pict, bmp, qtif, psd, sgi, and tga to/from each other Constrain size (reduce width and/or height while maintaining aspect ratio) Flip Rotate Crop Pad (with or without a specified color) Since the workflow does not really need all the power of ImageMagick, it might be better to use a tool included with OS X. It would reduce the weight tremendously. Cheers Well, I never heard of sips. It does look like a nice tool, but I can not find anything in the documentation on removing alpha channels or changing the image to a small palette of colors. I originally made it with ImageMagick because I am used to using that tool (I come from Windows/Linux. I have only had a Mac for 8 months.). I wrote this workflow to cover the need (take an image, remove alpha channel, compress the color space to 512 colors, and resize to a 930 px width.) I had and decided to share it. But, people had problems installing ImageMagick, so I included it inside it. Now, I can't seem to get GitHub to serve it properly. I will post the CompressImage workflow from my own website. I will post a link here for anyone that wants it when I get it up and tested there. Sorry for the problems. Link to comment
raguay.customct Posted April 26, 2013 Author Share Posted April 26, 2013 Okay, I now have a download for it on my web site: http://www.customct.com/downloads/compress-image-workflow/. Give it a try from there. Sorry, I can not get it to work from GitHub. Link to comment
Abigail111 Posted October 21, 2013 Share Posted October 21, 2013 HI there Your sharing really helps me a lot.I often convert the image using another image converter before.but it can not supports to convert image to png.That's a pitty. So i want to get some new powerful program for image converting.It would be better if it's free to use.Thanks a lot. Link to comment
raguay.customct Posted October 21, 2013 Author Share Posted October 21, 2013 Just set the extension to "png" using "ci.ext" and all images processed with the workflow will be converted to png. It uses ImageMagic, a free image processing package that is commandline based. Link to comment
Tyler Eich Posted December 10, 2013 Share Posted December 10, 2013 This image conversion control can be used to conduct single or batch image and document conversion. It supports more than thirty image and document formats, including PDF, TIFF, GIF, BMP, JPEG and so on. Unfortunately, this tool is for Windows, not OS X Link to comment
Krazay Posted August 6, 2019 Share Posted August 6, 2019 On 12/9/2013 at 8:06 PM, Tyler Eich said: Unfortunately, this tool is for Windows, not OS X I have been stumped for two days, saying this isn't working. Didn't know about alfred being on Windows. Maybe they should have some type of marking on the working workflows. So we know if we can do it on which platform. Less Confusing. Link to comment
rvnikita Posted June 21, 2022 Share Posted June 21, 2022 I have created bash script by using "magick convert" command to do that from Finder. You can find project here https://github.com/rvnikita/alfred_webp_to_jpeg Let me know if you need help with it. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now