Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What command i need to run to put in img/ folder with same name on ubuntu jpg file with 35% quality converter from jp2? On windows i run such bat:

for /d %%d in (*) do (
  for %%f in ("%%~d\*.jp2") do (
    convert -limit memory 0 -limit map 0 "%%~ff" -quality 20 "%%~dpf\jpg\%%~nf.jpg"
  )
)

but what and how to do with ubuntu to convert jp2 to jpg with 35% and put jpg's in /img folder?

share|improve this question
add comment

1 Answer

I can't speak for the quality setting because I haven't looked it up but when I want to process a lot of images I normally run them into another location using mogrify. I just converted a whole directory of TIF images on Ubuntu using the following.

mogrify -path tmp -format jpg -quality 35 *.tif

All the images retained their name, were converted into JPG, and were placed into a subdirectory called tmp. I could have specified a full path, but this is how I normally do it so it was already set up.

Mogrify will write over images in place (if you don't specify the path) so test the command and be careful until comfortable with it.

share|improve this answer
    
note! from jp2 to jpg –  brabertaser1992 Feb 24 '13 at 13:40
    
Good point, though I was just showing an example, had a folder of TIFs and wanted to copy and paste the exact command line. So it should be noted that there are several options and permutations possible. This is just an example of how to use mogrify on several images into another folder. –  Dennis Feb 24 '13 at 14:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.