Community > General chatter
The General Random Thoughts and Conversation Thread.
altuixde:
Anyone here experienced with imagemagick? I know that this command will scale down a bunch of images:
convert *.jp2 -scale 50% -quality 40 scaled-%d.jp2
but I'd also like to keep the original file names as part of the output file names. The above command produces output files named scaled-0.jp2, scaled-1.jp2 and so on. I'd like to have file names like [original file name]-scaled instead. While I'm at it, how can I activate scaling algorithms other than nearest neighbor (like catrom)?
Cael K.:
--- Quote from: altuixde on February 09, 2016, 08:07:56 pm ---Anyone here experienced with imagemagick? I know that this command will scale down a bunch of images:
convert *.jp2 -scale 50% -quality 40 scaled-%d.jp2
but I'd also like to keep the original file names as part of the output file names. The above command produces output files named scaled-0.jp2, scaled-1.jp2 and so on. I'd like to have file names like [original file name]-scaled instead. While I'm at it, how can I activate scaling algorithms other than nearest neighbor (like catrom)?
--- End quote ---
I don't know this program at all, but just 'cause I'm curious, I went ahead and looked at their site. They say this for scale:
--- Quote from: http://www.imagemagick.org/script/command-line-options.php ---The results are thus equivalent to using -resize with a -filter setting of box. Though it is a lot faster, as it avoids all the filter processing of the image. As such it completely ignores the current -filter setting.
--- End quote ---
So -filter and -resize immediately look like what we want to me. -filter seems to have a bunch of options you can use, Catrom being one of them.
http://www.imagemagick.org/script/command-line-options.php
http://www.imagemagick.org/script/command-line-processing.php
Ctrl-F those to get to what you wanna look up. As for image name, with the few minutes I've spent looking this stuff up, I can't give a definite yes or no, but I did find a page that talks about the escape characters they use.
http://www.imagemagick.org/script/escape.php
I assume this is for all the command line options they have with a quick skimming, and if so, you might want to look at %i, %t, or %[base]. There could be others.
So, I'd imagine something like...
convert *.jp2 -filter Catrom -resize 50% %t-scaled.jp2
... would be close to something you'd want. Again, I'm just reading what they've said, so you might wanna look over it yourself a bit. Hope I've given a pointer or two, though.
altuixde:
Thank you for your help, Cael! It looks like using -resize and -filter Catrom is producing the desired effect. However %i, %t, and %[base] all failed to produce the original file name. I'll look through the links you posted and see if I can figure it out. Actually, I'll have to do it at some indefinite time in the future because I'm kinda busy right now. That's why I posted my question instead of hunting for the answer myself. ^_^
DeviantProtagonist:
God damn, I'm one happy bugger right now.
As of today I just got my IC3 certification from our Certiport conference. It's basically literacy for computers and networking, so there's no doubt it'll look grand on my resume in the coming future. Now I can just laze around in glorious glory for the remaining time I have here. :P
mariokirby:
^
Cool. Sounds awesome. I know you'll be busy, but I hope you will be able to stick your head here once in a while.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version