FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   saving images, and then loading them again?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: saving images, and then loading them again?  (Read 557 times)
TomC

WWW
saving images, and then loading them again?
« on: Mar 12th, 2004, 12:05pm »

So I save my image to the processing folder using:
 
Code:

img.save("myimg.tif");

 
But I can't get it back again using:
 
Code:

img = loadImage("myimg.tif");

 
because that looks in the data folder.
 
I know this is fixed for forthcoming releases, but is there a workaround?
 
mKoser

WWW Email
Re: saving images, and then loading them again?
« Reply #1 on: Mar 12th, 2004, 12:51pm »

how about sacing directly to your datafolder?
 
Code:

save("sketchbook/default/saveload_test/data/this.tif");

 
? mikkel
 

mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
toxi

WWW
Re: saving images, and then loading them again?
« Reply #2 on: Mar 12th, 2004, 1:06pm »

tom, you can use loadImage() only for GIF/JPEGs. i've written a TGA loader a few days ago, but people keep deleting threads from the forum, really annoying...
 
now you can find the code over here though...
 
just use img.save("myimg.tga")
 
as for targetting the saved file, i think you'll have to use the absolute filepath to your P5 folder...
 
eg. img=loadImage("c:/p5/processing-0068/myimg.tga");
« Last Edit: Mar 12th, 2004, 1:10pm by toxi »  

http://toxi.co.uk/
TomC

WWW
Re: saving images, and then loading them again?
« Reply #3 on: Mar 12th, 2004, 1:13pm »

Cool, thanks guys.
 
This was one of those things where I'd got so side-tracked, I'd actually forgotten what I was trying to do in the first place!
 
fry


WWW
Re: saving images, and then loading them again?
« Reply #4 on: Mar 12th, 2004, 3:24pm »

on Mar 12th, 2004, 1:06pm, toxi wrote:
tom, you can use loadImage() only for GIF/JPEGs. i've written a TGA loader a few days ago, but people keep deleting threads from the forum, really annoying...

what.. people are deleting them is that possible i thought only the admins could delete (and we don't, unless someone posts the same message in four forums or that sort of thing). hrm.
 
edit / that thread is here:
http://processing.org/discourse/yabb/board_Programs_action_disp_lay_num_1078459847.html
are there other things that're being deleted though
 
also, i never added .tif support to loadImage(), for fear that it would cause trouble when using anything but tiff images generated by p5 (a headache to document) since a generic tiff loader is very complex (though included in later versions of java. should loadImage() for p5's tiffs be in there
« Last Edit: Mar 12th, 2004, 3:27pm by fry »  
toxi

WWW
Re: saving images, and then loading them again?
« Reply #5 on: Mar 12th, 2004, 3:31pm »

okay - sorry, my mistake...
 
but i think everyone (registered) can delete threads they started themselves... remember this one
 

http://toxi.co.uk/
TomC

WWW
Re: saving images, and then loading them again?
« Reply #6 on: Mar 12th, 2004, 4:09pm »

on Mar 12th, 2004, 3:24pm, fry wrote:

also, i never added .tif support to loadImage(), for fear that it would cause trouble when using anything but tiff images generated by p5 (a headache to document) since a generic tiff loader is very complex (though included in later versions of java. should loadImage() for p5's tiffs be in there

 
Yes please.  I'd quite like to be able to save/load a lossless cache of a p5 image.  How about PNG  For pre 1.4 SDK folks there's http://catcode.com/pngencoder/ which is LGPL.  I'd be happy to look at adapting this for Processing (it would actually be simpler, since you start with pixels).
 
Am I missing a trick, or does BImage.save() produce to tif only  if loadImage() works with GIFs, is it possible to use BImage.save() to produce a greyscale GIF, as that would be adequate
« Last Edit: Mar 12th, 2004, 4:40pm by TomC »  
fry


WWW
Re: saving images, and then loading them again?
« Reply #7 on: Mar 12th, 2004, 5:27pm »

ah, that's a nice png encoder. very terse.. most of the ones i've seen are another 100k or so.  
 
so along with toxi's new .tga reader, i'll do a simple .tif reader that can read p5's uncompressed tiffs for the next release or shortly after. but it sounds like we need a method for registering new image i/o types, so that people can read/write their own preferred formats but can be included from the code folder, so it doesn't make the default .jar file get too overweight.
 
Koenie

170825270170825270koeniedesign WWW Email
Re: saving images, and then loading them again?
« Reply #8 on: Mar 12th, 2004, 5:42pm »

I did a little thing with Martin a while ago that also is able to save to JPG: http://processing.org/discourse/yabb/board_Tools_action_display__num_1066742994_start_.html
 
Koenie
 

http://koeniedesign.com
trip

triparepa WWW Email
Re: saving images, and then loading them again?
« Reply #9 on: Mar 14th, 2004, 4:17am »

ooo, ooo, please a PNG loader... with full alpha support. That would be so nice...
 
c
 
Pages: 1 

« Previous topic | Next topic »