Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I have around 200 hundred PNG small images and I would like to convert all of them into JPG with a black background.

I usually do these kind of batch work with FastStone Image Viewer but there are no option for background color.

Can you suggest me a method and a program that I can use to achieve that result?

share|improve this question
    
Photoshop is the best.. –  Jack Oct 7 '11 at 4:58
2  
@Jack: That would be a matter of debate in these parts. Photoshop is popular, but that doesn't necessarily make it the best. –  Philip Regan Oct 7 '11 at 18:10
    
yes could be but photoshop is best for the given situation...may be there are lots of other option...no personal attachment with ps :D –  Jack Oct 8 '11 at 4:37
add comment

4 Answers

up vote 3 down vote accepted

Using ImageMagick's command line tools, you could do:

$ composite -compose Dst_Over -tile pattern:GRAY0 image.png image.jpg

Which

  1. Uses pre-generated pattern (GRAY0) that is solid black
  2. Puts the pattern behind (-compose Dst_Over) your png-file image.png
  3. Tiles the pattern (-tile) so it will fill the whole canvas
  4. Intelligently saves the composite image as JPG (IM recognises the needed conversion from image.jpg's extension)

Now, the aforementioned command can only do one composite image at a time, but you could hook to and loop it with other command line tools—be it Windows' command line, bash or anything else. (Looking at your profile, you might be most interested in Windows' tools.)

share|improve this answer
1  
I don't have Photoshop and I tried your solution first, thank you it works perfectly. If you want to add that for people working with XP that usually don't have the ForFiles utility, they can download it here. This is the batch ready to use: forfiles -m*.png -c"CMD /c composite -compose Dst_Over -tile pattern:GRAY0 @FILE @FNAME_WITHOUT_EXT.jpg" –  Drake Oct 17 '11 at 14:03
    
Just to complete for Windows Vista or later here it is the command ready to use: forfiles /m *.png /c "CMD /c composite -compose Dst_Over -tile pattern:GRAY0 @FILE @FNAME.jpg" –  Drake Dec 12 '11 at 18:36
add comment

In Photoshop - Action and Batchor Image Processor is what you need:

http://graphicssoft.about.com/od/digitalphotography/l/blps_batch.htm

So this is how it would basically go:

  1. Make Action where you create a new layer at the bottom and fill it with color.
  2. Use File > Automate > Batch or File > Scripts > Image Processor to execute that recorded Action to all of the images.

Edit:

My bad!

I got thinking about it and you can also run Actions through File > Scripts > Image Processor as well and as you can convert the file.. if I remember correctly: jpeg, psd and tiff So, it would work better in your case.

So instead of Batch use Image Processor.

But, I'll keep that part about saving image inside Action because that allows you to save it in more formats than Image Processor


Saving image in another format in Batch

Unless cs 5 has way to do this better.. Converting the file format can't be done with batch.

You can however do this:

  • As part of the Action where you create new layer and fill it with color, also save the file with the format you want and to the folder you want, then close the document ctrl+w and then go to batch and select destination as none and run the Batch.
share|improve this answer
add comment

Actually, if you're going to use Photoshop, I suggest File->Save for Web & Devices. I'm usually surprised how many artists overlook this very handy option (I use it so often I have it hot keyed to F2).

This brings up a dialog that allows you to set the output format to JPG with a specific matte color, automatically flattening your image. Of course, you can also set quality, color depth, and many other options such as dithering. This command is also batch-able, and this single step will go much faster.

Although not part of your question, this command also allows you to preview the quality and resultant file size before saving. You can even compare up to four different settings side-by-side before choosing. Hope this helps!

share|improve this answer
add comment

give this image programme a shot, it will blow you, also you can do batch conversion.

share|improve this answer
2  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  Scott Apr 24 '13 at 7:19
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.