Page 2 of 2
Re: Compressing Images to be stored in Cloud
Posted: Tue Jul 08, 2014 11:27 pm
by FourthWorld
William Jamieson wrote:@Richard:
Would you happen to know a quick and easy way to resize and change the filesize of PNGs and GIFs Richard?
Same as Simon suggestion, with export snapshot. But by doing it in the client (assuming the client app is make with LC) you'd be uploading a much smaller file, and with the resizing done in advance the server load would be very minimal.
BTW I hope to see you at RunRev Live 14 in San Diego. Just got my ticket!
Looking forward to it. Many good sessions lined up, with lots of celebration in between. Should be a good time. San Diego's a wonderful place.
Re: Compressing Images to be stored in Cloud
Posted: Wed Jul 09, 2014 4:03 am
by William Jamieson
You are absolutely right. The word
as is the critical factor.
After looking at the documentation on export snapshot, in the examples they included PNG format. Here is the sample code:
Code: Select all
export snapshot from Field 1 to file "File1.png" as PNG
I am going to test if this preserves the alpha transparency of an image in a sec.
Re: Compressing Images to be stored in Cloud
Posted: Wed Jul 09, 2014 4:17 am
by William Jamieson
Yess!!! I confirmed that it does indeed preserve alpha transparency!! Thank you Simon and Richard! Ah I think I got confused about the difference between import snapshot and export snapshot. I still don't really understand the difference, but when I went to go look up your suggestion or try use it, I was using the
import command rather than export.
Rookie mistake. Glad I'm in the rookie forum

Re: Compressing Images to be stored in Cloud
Posted: Wed Jul 09, 2014 4:34 am
by FourthWorld
William Jamieson wrote:Yess!!! I confirmed that it does indeed preserve alpha transparency!!
As a general rule, both import and export will preserve the inherent transparency of any object provided you use the "of object" rather than "from rect" form.
The older "from rect" form grabs a specific rect from the composite buffer, so it's doesn't have the smarts to do anything more with it. But the newer "of object" form causes the object to be rendered directly into its own new buffer.
Extra cool is that the newer "of object" form can be used on any object, not just images, including buttons, groups, etc., and will leave the empty space around objects as transparent in the resulting alpha channel.