any way to set depth of a .png file?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

any way to set depth of a .png file?

Post by adventuresofgreg » Wed Nov 12, 2014 9:21 pm

Hi: I am exporting many .png files, and I'm converting them to a way smaller file size using a conversion utility than changes the color depth. Is there any way to do that within LiveCode as I export? I know I can set a .jpg compression, but these files have to be .png with alpha. According to the dictionary,

"If the image has an alpha channel, the export snapshot ... as PNG form creates a 32-bit PNG file."

so maybe not...

export snapshot from graphic "ThisGraphic" to file saveplace as PNG

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: any way to set depth of a .png file?

Post by Klaus » Wed Nov 12, 2014 9:47 pm

Hi Greg,

never used this feature, but look under "export with palette" in the dictionary.
Looks like you need to "store" the snapshot temporarily in an image in the stack before "export ... with palette...".


Best

Klaus

adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: any way to set depth of a .png file?

Post by adventuresofgreg » Wed Nov 12, 2014 10:01 pm

BINGO! excellent. That worked - I shaved a 30 KB file down to a 4 KB file. Thanks Klaus.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: any way to set depth of a .png file?

Post by Klaus » Wed Nov 12, 2014 11:25 pm

Cool! :D



Your message contains 8 characters. The minimum number of characters you need to enter is 10.

Post Reply