-
-
Save jpatel3/4627147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//image modifier will make images all the same size | |
PImage[] tempImages; | |
String rootDir = "C:/Users/Ben/Dropbox/TuvaLabs UI-UX Design/Mock-ups/Assets/Images for Personalization Page/"; | |
ArrayList directories, names; //holds the directories for all image files to be modified | |
void setup(){ | |
size(200,150); | |
directories = new ArrayList(); | |
names = new ArrayList(); | |
File file = new File(rootDir); | |
for(int i = 0 ; i < file.list().length ; i++){ | |
File subFile = new File(rootDir + file.list()[i] + "/"); | |
for(int j = 0 ; j < subFile.list().length ; j++){ | |
directories.add(rootDir + file.list()[i] + "/" + subFile.list()[j]); | |
names.add("c_" + file.list()[i] + "_" + subFile.list()[j]); | |
} | |
} | |
tempImages = new PImage[directories.size()]; | |
for(int i = 0 ; i < tempImages.length ; i++){ | |
tempImages[i] = loadImage((String) directories.get(i)); | |
image(tempImages[i],0,0,width,height); | |
save((String)names.get(i)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment