New Beginner
Moderators: Dorian (MJT support), JRL
New Beginner
I have downloaded Macro Schedular and are new to this type of software, I develop scenery for a particular Flight Simulator and one of the areas that I help develop and design is the Scenery for this Simulator.
Here is what I would like to complete in making a script and hope that I have explained well enough to understand.
I have over 1000 bitmap images that are 800 x 800 pixels in size, with the first file being named like in this example below:
Layer_D1.bmp
I would like to split the above bitmap image into 4 smaller bitmap images so would end up with 4 x 400 x 400 pixels in size and would name these with the following names:
Layer_D1a.bmp
Layer_D1b.bmp
Layer_D1c.bmp
Layer_D1d.bmp
Then repeat this process many times, I'm not sure how best to approach this idea.
Will look forward to if anyone is able to help.
Thank you.
Here is what I would like to complete in making a script and hope that I have explained well enough to understand.
I have over 1000 bitmap images that are 800 x 800 pixels in size, with the first file being named like in this example below:
Layer_D1.bmp
I would like to split the above bitmap image into 4 smaller bitmap images so would end up with 4 x 400 x 400 pixels in size and would name these with the following names:
Layer_D1a.bmp
Layer_D1b.bmp
Layer_D1c.bmp
Layer_D1d.bmp
Then repeat this process many times, I'm not sure how best to approach this idea.
Will look forward to if anyone is able to help.
Thank you.
I'd start by using GetFileList> to create a list of BMP file names. Then I'd create a dialog that displayed each BMP one after another. While each BMP is displayed on the dialog use ScreenCapture> 4 times in the four sectors of the displayed BMP to capture 400 x 400 pixels areas and write the results to a new location with the required name.
Sounds easy enough if all the BMPs are sized correctly. I'm not sure about the specifics of a SceenCapture> generated BMP file. If you have specific requirements, you may want to ask Marcus what type of BMP will be created before you spend the time on this.
Sounds easy enough if all the BMPs are sized correctly. I'm not sure about the specifics of a SceenCapture> generated BMP file. If you have specific requirements, you may want to ask Marcus what type of BMP will be created before you spend the time on this.
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
If you are doing this kind of image manipulation it's worthwhile to get familiar with ImageMagick, a very versatile, free, suite of tools which can be very conveniently automated with MacroScheduler. I assumed the images were numbered sequentially so this would be my code to do what you request:
If the filenames aren't sequential then you will have to use GetFileList> as JRL suggests.
Code: Select all
//change to the imagemagick install directory
Change Directory>C:\IMAG
//set up a repeat loop
Let>k=0
Repeat>k
Let>k=k+1
//crop the image 4 times
RunProgram>convert.exe c:\temp\Layer_D%k%.bmp -crop 400x400+0+0 c:\temp\Layer_D%k%a.bmp
RunProgram>convert.exe c:\temp\Layer_D%k%.bmp -crop 400x400+0+400 c:\temp\Layer_D%k%b.bmp
RunProgram>convert.exe c:\temp\Layer_D%k%.bmp -crop 400x400+400+0 c:\temp\Layer_D%k%c.bmp
RunProgram>convert.exe c:\temp\Layer_D%k%.bmp -crop 400x400+400+400 c:\temp\Layer_D%k%d.bmp
//end the looping when all images are processed (change 2 to the correct number
Until>k,2
I have the Editor window open, then click on the + button next to File Handiling, if I then drag the GetFileList to the main editor window nothing happens, or if I right click on the mouse then 3 options become available, Insert Command, Add to Favorites and Command Help.
Is it a simple mistake that I have made, I'm sure I will have many questions but first is there an area that I should read first.
Is it a simple mistake that I have made, I'm sure I will have many questions but first is there an area that I should read first.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Just left click on it once. A dialog will come up helping you to construct the command and insert it into the editor.
Or, just type into the editor.
Or, just type into the editor.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I think I'd go with Me_again's approach - automate ImageMagick.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Me_again,
Below is a step by step guide to exactly what steps I'm taking.
Open Layer_D1.bmp bitmap
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - File then Save As
Save file name as - Layer_D1a
Open Layer_D1.bmp bitmap
Select - Image then Flip and Rotate and select Flip horizontal
Click OK
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - Image then Flip and Rotate and select Flip horizontal
Select - File then Save As
Save file name as - Layer_D1b
Open Layer_D1.bmp bitmap
Select - Image then Flip and Rotate and select Flip Vertical
Click OK
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - Image then Flip and Rotate and select Flip Vertical
Select - File then Save As
Save file name as - Layer_D1c
Open Layer_D1.bmp bitmap
Select - Image then Flip and Rotate and select Flip Vertical
Click OK
Select - Image then Flip and Rotate and select Flip horizontal
Click OK
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - Image then Flip and Rotate and select Flip Vertical
Select - Image then Flip and Rotate and select Flip horizontal
Click OK
Select - File then Save As
Save file name as - Layer_D1d
Below is a step by step guide to exactly what steps I'm taking.
Open Layer_D1.bmp bitmap
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - File then Save As
Save file name as - Layer_D1a
Open Layer_D1.bmp bitmap
Select - Image then Flip and Rotate and select Flip horizontal
Click OK
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - Image then Flip and Rotate and select Flip horizontal
Select - File then Save As
Save file name as - Layer_D1b
Open Layer_D1.bmp bitmap
Select - Image then Flip and Rotate and select Flip Vertical
Click OK
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - Image then Flip and Rotate and select Flip Vertical
Select - File then Save As
Save file name as - Layer_D1c
Open Layer_D1.bmp bitmap
Select - Image then Flip and Rotate and select Flip Vertical
Click OK
Select - Image then Flip and Rotate and select Flip horizontal
Click OK
Select - Image then Attributes
Change Width from 800 to 400
Press Tab Key
Change Height from 800 to 400
Click OK
Select - Image then Flip and Rotate and select Flip Vertical
Select - Image then Flip and Rotate and select Flip horizontal
Click OK
Select - File then Save As
Save file name as - Layer_D1d
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
>> Open Layer_D1.bmp bitmap
In what? Photoshop, Fireworks, Paintshop Pro, Paint, Apperture, Lightroom, ..... ? Either way - you know the app better than we do.
Read:
http://www.mjtnet.com/blog/2006/01/17/h ... on-script/
In what? Photoshop, Fireworks, Paintshop Pro, Paint, Apperture, Lightroom, ..... ? Either way - you know the app better than we do.
Read:
http://www.mjtnet.com/blog/2006/01/17/h ... on-script/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?