February 11, 2011

Automatic diffuse.jpg + alpha.jpg to TIF

When you buy collections of plants, people, trees or whatever on the web, you often receive (for a reason of web transfert I suppose) 2 JPGS, one with alpha and the other with diffuse... So to get a transparent TIF, you first need to open the diffuse, put the alpha on it, select channel, delete, save ... etc etc ... ok for 1, let's say 2, 3 , 10 images... but when there are hundreds, it's a real timeloss ... Here is a little script that'll quickly do the job for you ... Let's see it in action first :



Well sorry, no audio yet, but it'll come soon !
Ok ... For those who are still interested, there is a little setup to do first ...but once it's done... it's really quick.





Your pictures must be jpgs divided in 2 folders at the same level, one named diffuse and the other alpha.
and files MUST be named XXXXdiffuse.jpg and XXXXalpha.jpg. where XXXX are the same for each pair of JPGS. It was done this way because the collection I wanted to process was named this way when bought. But if you like javascript you can change this in the script, otherway you can easily set these names with batch rename.


then you must download this SCRIPT and copy it in your photoshop\Presets\Scripts folder. Then start/restart photoshop.

We are now gonna create an action to run the script ... this is quite stupid, but as far as I know the batch of photoshop needs an action to run a script ... (??!?!!!)




Open a first diffuse image, create a new action (menu window/action to display) and go to file -> script -> Alpha+DiffuseToTIFF, then stop the recording.



If all goes well the script should run and you should have a first tif generated in the root folder

That was the "tricky" part...

Now let's work a lot without using your hands ...

Go back to File/automate/Batch





Select the action you just created. Then click on "Choose" and select the DIFFUSE folder. Finally, click "OK".

Test it, tweak it, ask questions if you have... Once more it was created upon my needs in this situation, but I taught it may save some time for other people.

This morning I processed about 750 of these in a hour ... Without this I think I would have spend a real loooong and boooorrrry day.

M!ke

P.S : Do not hesitate to say if it doesn't works !

3 comments:

  1. great job! Could you tell me where can i find trees? alpha and diffuse maps? thanks!

    ReplyDelete
  2. Hi ! The one here are from ProViz, but you buy / find loads of others on google.

    Maybe try epictor, imagecels, kropped, vyonyx, Got3D... etc etc...

    ReplyDelete