Closed Thread Icon

Topic awaiting preservation: Action to 'dice' images into sequentially numbered little squares? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=9264" title="Pages that link to Topic awaiting preservation: Action to &amp;#039;dice&amp;#039; images into sequentially numbered little squares? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Action to &#039;dice&#039; images into sequentially numbered little squares? <span class="small">(Page 1 of 1)</span>\

 
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 10-06-2003 00:31

Hi guys,

This is a pretty urgent request - I need a way to take images of a preset size and slice them up into seperate little image squares which are each saved with a sequential number starting with the first square (top left) but in a grid type pattern - so the first square would be saved as '1-1.jpg' and the one to the right of it would be '1-2.jpg' and the one to the right of that would be '1-3.jpg' etc. Then the next row would be like '2-1.jpg', '2-2.jpg', 2-3.jpg' etc. and so on.

Is there anyone who would possibly be able to help write an action to do this automatically?

I know it's a large request but I'm not so good with complex actions and don't know where to begin with this.

Please help if you can. The final 'diced' images are to be used in a website which is a college project of mine, I'm fine with building the website, I'm just not so good with actions and really don't want to have to slice a number images individually (I'm currently estimating there will be a large number of little squares per image - something in the region 300 or so...). If anyone can help I'll work out the exact figures and dimensions so it can be done.

Thank you ever so much,

Jon

jstuartj
Bipolar (III) Inmate

From: Mpls, MN
Insane since: Dec 2000

posted posted 10-06-2003 03:43

I would do this in ImageReady, It should be a fairly simple action, the hard part will be defining the guides or slices,
But not to bad if they are to be cut to the same template. You may have to do a bit of tweeking to get naming to work how you deisre.

I would use the guide method as following:

1. From the action menu, Create an action name it Slice&Dice

2. Stop it from recording

3. Select "Insert Output Folder" from the action menu and select your desired output directory.

4. Choose your optimize setting and Select Input Optimize setting from the action menu.

5. Load your template image.

6. Start the action recording again.

7. Drag out Guides where you want to cut up the image

8. Select Create Slices from Guides from the selection menu

8a. (option) Record selecting each slice to rename to match you naming format and adjust other options.

9. Select Save as Optimized, You should not touch the filename or directory or it will be recorded, you may however edit any of the other settings such as images only and name save options, etc.....

10. Stop Recording.

11. You may now use the action as a batch or save it as a droplet for drag and drop processing of your images. All output will go to the output folder specified.

Slices could also be used but it would be a little more complex to setup.


Now for the realy cool thing!. Unlike Photoshop 7, ImageReady Action are simple text files, and can be edited by hand. They however are a little hard to find, they are located on Windows 2K and XP in:

C:\Documents and Settings\<YOUR_USERNAME>\Application Data\Adobe\ImageReady\7.0\Settings\ImageReady Actions

The folder is hidden for so you may have to turn on Show Hidden files or do a search for hidden files.


I don't have access to Photoshop 7 on Mac right now, but simply record one with a unique name and search.


Here is the text for my basic action. Simply copy and paste it into a blank text document, Save and name it Dice&Slice.isa, then copy it into the action folder location I listed above. It should appear when you reload ImageReady, if not use the "Rescan Action Folder" located in the action menu. One it's in the action menu you can use it as a batch or create a droplet for drag and drop processing.

You may edit it to include as many guides and commands as desired. You can add "guideAxis_Vert" or "guideAxis_Horz" guides, see the examples in the script below. Simply copy and paste, incroment the set number and change measurements in pixels. Just renumber the last two steps need to be renumbered, they don't have to be direct inorder simply higher then the rest. I labled them steps 100, and 101 when ImageReady loads the action it will renumber correctly inorder.

You could also add slices by hand, to find out the format for a slice simply record a simple action and load it in a text editor. I tried a hand editing a hand sliced action but found it easyer to do the guide method.

code:
// ===========================================================================
// Action file - Generated by Adobe ImageReady 7.0
// ===========================================================================


{
action = new Action("Slice&Dice");
action.expanded = false;
action.runInBackground = false;
action.saveSource = false;
action.saveTarget = true;
action.targetLocation = tlSourceFolder;
action.dupFileNameBehavior = dfnAdd2Digits;
action.windowsFileNaming = true;
action.macFileNaming = true;
action.unixFileNaming = true;
action.displayImages = false;
action.pauseBeforeSave = false;
action.errorBehavior = dfnOverwriteConfirm;
action.version = 2;

step1 = new SetOutputFolder;
step1.enabled = true;
step1.doDialog = false;
step1.expanded = false;
step1.outputFolder = "F:";
action.AddStep(step1);

step2 = new SetTargetSettings;
step2.enabled = true;
step2.doDialog = true;
step2.expanded = false;
step2.fileFormat = ffJPEG;
step2.optimized = true;
step2.qualitySetting = 30;
step2.multiplePasses = false;
step2.blurAmount = 0.000000;
step2.iccProfile = false;
step2.exifMetadata = false;
step2.matteRed = 255;
step2.matteGreen = 255;
step2.matteBlue = 255;
action.AddStep(step2);

step3 = new CreateGuide;
step3.enabled = true;
step3.doDialog = false;
step3.expanded = false;
step3.axis = guideAxis_Horz;
step3.location = 173;
action.AddStep(step3);

step4 = new CreateGuide;
step4.enabled = true;
step4.doDialog = false;
step4.expanded = false;
step4.axis = guideAxis_Vert;
step4.location = 226;
action.AddStep(step4);

step5 = new CreateGuide;
step5.enabled = true;
step5.doDialog = false;
step5.expanded = false;
step5.axis = guideAxis_Horz;
step5.location = 300;
action.AddStep(step5);

step6 = new CreateGuide;
step6.enabled = true;
step6.doDialog = false;
step6.expanded = false;
step6.axis = guideAxis_Vert;
step6.location = 316;
action.AddStep(step6);

step100 = new SliceAlongGuides;
step100.enabled = true;
step100.doDialog = false;
step100.expanded = false;
action.AddStep(step100);

step101 = new SaveOptimized;
step101.enabled = true;
step101.doDialog = false;
step101.expanded = false;
step101.saveHTML = false;
step101.saveImages = true;
step101.saveSelectionOnly = false;
step101.saveSelectionNamed = "";
action.AddStep(step101);




Oh ya! Don't forget to edit the location of the output folder, I have it set to F: in the code above.

Hope this helps

J. Stuart J.



[This message has been edited by jstuartj (edited 10-06-2003).]

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 10-07-2003 10:22

thanks for your help bud,

it all seemed a little bit confusing tho, no your fault, I blame adobe

anyway, the php forum came up with a solution which works great so just in case anybody comes here looking to do a similar thing then the link to the solution is here:
http://www.ozoneasylum.com/Forum12/HTML/001580.html

I really appreciate your help tho,

Jon

visit my CryoKinesis Online Gallery

« BackwardsOnwards »

Show Forum Drop Down Menu