automation in image processing
in
Programming Questions
•
6 months ago
quick question, is their a way to automate this process, so all i have to do is allow this program to run, i want the program to load each image process it and save the new image when the frame count gets to 6 and then load the next image and so on etc ... until the final image so by the end i am left with a sequence of new images in correspondent to the original image, is their a way to automate this process or do i have to this manually
here is the code
- PImage img;
- int a = 900;
- void setup() {
- //size(displayWidth,displayHeight); // get a sequence of colours of the image
- size(a,a);
- noStroke();
- frameRate(2);
- img = loadImage("pixie/spinks-pixie010.jpg");// absolute path loads images anywere put file name before image name
- smooth();
- background(255);
- //rectMode(CORNER); //get a sequence rather than a collage
- loop();
- }
- void draw() {
- // image(img, 0, 0);
- //background(255);
- int ix = int(random(img.height));
- int iy = int(random(img.width));
- color c = img.get(ix,iy);
- fill(c,102);// 102 for gradient effect
- int xgrid= int (random(-2,15))*10;
- int ygrid = int(random(-2,10))*10;
- //strokeWeight(10);
- //stroke(c,102);
- rect(xgrid,ygrid,a,a);
- //line(random(900),random(900),random(900),random(900));
- //rect(random(700),random(700),100,100);
- //if(mousePressed==true){
- //saveFrame("line-0000.jpg"); //saves frames to sketch folder
- //
- if(frameCount == 6){
- saveFrame("Pixie010.jpg");// auto save frame when frame couts to 6 it save frame
- }
- }
- //void mousePressed(){// if mouse pressed save frame
- // saveFrame("Pixie004.jpg"); //saves frames to sketch folder //hash is alt+3 use hash rather than number auto numbering
- //}
1