Saving images

I am using processing that you can download from processing.org. It is free but your donation is welcome. Processing is built on Java. With processing you can easily create interesting images with small programs.

Once you have an image you want to save it. Using “save();” to do so is not a good solution. The image will be saved as a “.tif”-file together with your processing sources. It would be better to use another folder, a special file name and another filetype. For this we use “save(filePath);”, where filePath is a string containing all these informations. They can be choosen with “SelectOutput(…);”. However I had great difficulties with that.

You find my solution in the next post “Saving images – the code“. With “saveImage();” you can choose a folder and enter the name for the image file. If you don’t give a type extension it will become a “.png”-file, which is good for images with flat colors.

The post “Saving images – example” gives a sample program using this code. You should put it in the main tab of processing. It is the first tab at the left. The code for “saveImage();” has to be in a tab at the right of the main tab.

This entry was posted in programming, Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s