Photoshop script to cut Condor tiles - Update: Join tiles

Everything related to creation of new sceneries for Condor...

Moderators: Uros, OXO

dwbr
Posts: 29
Joined: Thu Dec 08, 2005 3:19 am

Photoshop script to cut Condor tiles - Update: Join tiles

Post by dwbr » Sat Nov 25, 2006 5:35 am

A small script that will cut a big image (texture) and save the tiles for Condor Toolkit... Tested with PhotoShop CS2 on a 144 tiles map (24576x24576 pixels image).


Updated: Join Tiles

Example, condor-join - Joins Condor Landscape textures to a big image:
1- Convert all .dds texture files to BMP (batch, get Irframview).
2- Edit condor-join.jsx, set the input directory and tiles resolution.
3- Open photoshop, create a new image. Size must be "number of tiles X tile resolution". Tip: get this info ftom the last .dds file. Resolution: 512x512 tiles, Last tile: t4749.dds, width will be (47+1)x512 and height (49+1)x512.
4- Run the script.
5- Rotate the image (180 degrees)
You do not have the required permissions to view the files attached to this post.
Last edited by dwbr on Thu Mar 20, 2008 3:57 pm, edited 1 time in total.

User avatar
Cadfael
Posts: 3703
Joined: Fri May 27, 2005 8:07 pm
Location: Czech republic
Contact:

Post by Cadfael » Tue May 08, 2007 11:23 am

I tried you script now but probably I am not understanding how it is work. I got as a result from one file with two layer two layers as a separate files with the same size. But I thought, that your script is cutting large bitmap to terragen squares with size 512x512? Be so kind and could you desribe how your script works?
Do you think that is a possible to write a script, which will cutting and saving from large file separate squeares with define size, 512x512 or 2048x2048? It could be great helper for creating a layers for photoshop from maps...
Image
Image

Kaido
Posts: 26
Joined: Tue Mar 20, 2007 3:06 pm
Contact:

Post by Kaido » Tue May 08, 2007 1:42 pm

I used that script for making Estonian scenery landscape bitmap from 21 000 x 20 500 bitmap. It works well and cuts 2048x2048 tiles form active Photoshop bitmap and saves them to C:/output folder. It starts from lowest rightmost corner and goes all the way to the top left. If I remember correctly, it cuts column-by-column, not row-by-row (may be wrong here). I don't know how it behaves regarding the layers, but in order to avoid confusion I suggest you to delete the unnecessary layers or flatten the image before the cut.

There's a problem with Photoshop bitmaps so the CST can't read resulting bitmaps and you need to open and save them with IrfanView for example if the images are on RGB. If they are B&W with 50% threshold, then IrfanView transforms them to lab color so you need some other photo manipulation tool for that (I used Corel Photopaint).

Regards,
Kaido

Image


KT
ES-1004

User avatar
Cadfael
Posts: 3703
Joined: Fri May 27, 2005 8:07 pm
Location: Czech republic
Contact:

Post by Cadfael » Tue May 08, 2007 1:50 pm

Thank you, Kaido.. I will try it again, because I need this tool for cutting great maps to 2048x2048. You are right with Photoshop CS2 files bug and I am sure, that at next version of CST it will be repaired..
Image
Image

User avatar
Cadfael
Posts: 3703
Joined: Fri May 27, 2005 8:07 pm
Location: Czech republic
Contact:

Post by Cadfael » Tue May 08, 2007 9:57 pm

So I looked at this script and it is a exactly tool, which I need. Easy, and now I can cut any my maps to files 512x512, 2048x2048 - which size I need. And these squares has a exact terragen square names! Thank you very much, dwbr, perfect!
Image
Image

dwbr
Posts: 29
Joined: Thu Dec 08, 2005 3:19 am

Post by dwbr » Sun Jun 03, 2007 6:32 am

I forgot to tell about this issue with the BMP files, did the same with Ifranview! :) I think this bug was corrected on the last toolkit version...Nice to know that the script was usefull.. :)

ASH33M
Posts: 1901
Joined: Wed Apr 20, 2005 1:01 am
Location: UK
Contact:

Post by ASH33M » Wed Jun 06, 2007 1:32 am

dwbr wrote:I forgot to tell about this issue with the BMP files, did the same with Ifranview! :) I think this bug was corrected on the last toolkit version...Nice to know that the script was usefull.. :)
If you have downloaded the CST Toolkit v1.01 then IrfanView is not required.

User avatar
GregNuspel
Posts: 1296
Joined: Wed Aug 31, 2005 1:45 am
Location: Calgary, Alberta, Canada

Post by GregNuspel » Wed Jun 06, 2007 1:30 pm

I get an error on line 3 when I try and run this. I've never used scripts so I could be doing something wrong.
--Greg Nuspel
Condor XCSoar Data

User avatar
Cadfael
Posts: 3703
Joined: Fri May 27, 2005 8:07 pm
Location: Czech republic
Contact:

Post by Cadfael » Wed Jun 06, 2007 3:30 pm

Open this script as a "edit", there are two constant: output directory and picture size. Default way is C:\output so it is reason. You are able to change both parameters and set size and path.
Image
Image

dwbr
Posts: 29
Joined: Thu Dec 08, 2005 3:19 am

Post by dwbr » Thu Jun 07, 2007 11:09 pm

Yes, you need to create the output directory...
Ohhhh.. sorry.. I am not good on documentation... hehehehe


Btw.. just tested with the new toolkit and worked just fine! :D

Tom
Posts: 2284
Joined: Wed Aug 09, 2006 4:16 pm
Location: Czech Republic
Contact:

Post by Tom » Sun Jan 13, 2008 6:14 am

maybe i am doing something wrong but my image say for example andes.bmp is 3328*11520 which is 13 columns of 44 rows of 2048*2048 bmp files. now when i run this script i get 5 tiles of 2048*2048 which appear to cover the whole scenery its like its reducing the size of the main image.
Image

User avatar
Cadfael
Posts: 3703
Joined: Fri May 27, 2005 8:07 pm
Location: Czech republic
Contact:

Post by Cadfael » Sun Jan 13, 2008 8:50 am

This script working perfect. But you need open it and set tile size and path here before use.
Image
Image

User avatar
Agentschlegel
Posts: 180
Joined: Tue Oct 25, 2005 4:27 pm
Location: Aix la Chapelle / Germany
Contact:

1 / condortiles :-)

Post by Agentschlegel » Fri Feb 29, 2008 12:58 pm

Hi dwbr!

Thanks for your script, it's really a lovely tool for us developers.
I was wondering if it was possible to create a script that works just the other way around.....Taking all the tiles from a directory and putting them back into one huge bitmap. I'd love it !!!

Best regards

björn
Provence 2.....all artwork

dwbr
Posts: 29
Joined: Thu Dec 08, 2005 3:19 am

Post by dwbr » Wed Mar 19, 2008 2:50 am

it is possible... :) will try to code a script to do the reverse task... :lol:

dwbr
Posts: 29
Joined: Thu Dec 08, 2005 3:19 am

Post by dwbr » Thu Mar 20, 2008 3:58 pm

done! check the first post... :)

Post Reply