We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello! I have a bit of experience with processing, but nothing really in depth, so perhaps someone with more experience than me can help. I am attempting to write a program that will take an image I have created, and quickly crop it into all the necessary sizes to be put onto Sense6 products. The code I have so far is:
PImage input;
void setup(){
size(2047, 2047);
surface.setResizable(true);
selectInput("Select an image to process:", "selectImage");
interrupt();
println("Delay stopped");
}
void selectImage(File selection){
if (selection == null){
println("error- no file selected");
}else{
input = loadImage(selection.getAbsolutePath());
println("image loaded");
}
}
void interrupt(){
while(input == null)delay(200);
}
void draw(){
PImage phoneCase; //1300px (width) X 2000px (height)
phoneCase = input.get(input.width/2-650, input.height/2-1000, 1300, 2000);
println("phonecase image got");
surface.setSize(phoneCase.width, phoneCase.height);
image(phoneCase, 0,0);
saveFrame("output/phoneCase.jpeg");
exit();
}
I've cut out a lot of the other products because I'm just trying to test it right now.
So anyway, what I'm expecting currently is an image in the folder (sketch folder)/output called phoneCase.jpeg that is 1300px X 2000px. Except that what I'm getting is an image called phoneCase.jpeg that is 1300px x 741px. 741px happens to be really close to the height of my monitor, which is 768px. This sketch gives no errors, so I have nothing to go on.
I looked into using code like save(phoneCase, "output/phoneCase.jpeg");
, but just based on the reference documentation, it seemed like that wouldn't work.
So, with my monitor being 1366px X 768px, how can I save a PImage that is 1300px X 2000px?
Answers
All PImage objects got method save(): L-)
https://Processing.org/reference/PImage_save_.html
X_X