Images in Livecode

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Images in Livecode

Post by [-hh] » Fri Aug 11, 2017 2:18 am

Hi, just follow the arrows.
There is only one button (orange), script has at about 30 lines, for compressing PNG -> JPNG.
And there is only one button (green), script has also at about 30 lines, for decompressing JPNG -> PNG.

In order to keep it simple the file-versions have their own buttons, the file system dialogs need some more lines. But the method is identical.
The fileformat structure is simply a header for width, height, useAlphaData, then the alphadata (or maskdata), then the JPEG-compressed imageData. Backwards convert the JPEG-data to PNG and set the alphaData/maskData. Of course we use additionally compress/decompress.

That's all. No advanced things in there. (One has to be careful when using the different parts of the data.)
The js- and objC-people have a "JPNG"-format that uses not a header but a footer. So a conversion between the two formats is easily possible.
shiftLock happens

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Images in Livecode

Post by bidgeeman » Fri Aug 11, 2017 10:18 am

Hi again :)
I have been searching the forum for a quick way of processing an image so that it's color
slightly changes. It's a transparent .png overlay of guidelines for measurements that sits over
the main image area. The lines are a very light blue color but I just realized that if a design is
loaded that is blue the lines on the grid will disappear into the design. I tried to convert it to
greyscalewith a greyscale script I found in one of Klaus's old threads but the image processing
takes a lot of time to process evey pixel. Can anyone suggest a quicker way out of this?

Thanks again
Bidge

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Images in Livecode

Post by [-hh] » Fri Aug 11, 2017 1:40 pm

Why don't you look at "Sample stacks" (sort by date downwards) of the LC toolbar:
'LCImageToolBox' or here:
http://livecodeshare.runrev.com/stack/826/ for use with LC 8/9 on Mac/Win/linux
http://livecodeshare.runrev.com/stack/827/ for use with LC 6/7/8/9 on Mac
??
shiftLock happens

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Images in Livecode

Post by bidgeeman » Fri Aug 11, 2017 1:49 pm

Oh thanks [hh]....I had not seen that stack before in the samples?
It looks like an answer is there somewhere :)

Bidge

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9386
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Images in Livecode

Post by richmond62 » Fri Aug 11, 2017 2:31 pm

TINTER.png
Last edited by richmond62 on Fri Aug 11, 2017 3:05 pm, edited 1 time in total.

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Images in Livecode

Post by bidgeeman » Fri Aug 11, 2017 2:40 pm

richmond62.
Thanks you so much. Maybe this is the reason I am having so much trouble with learning LC. I search and search for solutions and get multiple answers which I experiment with and then I post a thread and find out there is a much easier way to do things? It does make things difficult from a complete beginners point of view. Thanks to this forum though otherwise I would be doing things the long way :)

Thank you all again.
Bidge

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9386
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Images in Livecode

Post by richmond62 » Fri Aug 11, 2017 2:44 pm

It's not that simple: I just made a fool of myself in front of Klaus Nomi (whoops, Mayer) and Mark Waddingham
over on the Use-List.
klausnomi.jpg
Wrong Klaus

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Images in Livecode

Post by [-hh] » Fri Aug 11, 2017 2:50 pm

Richmond,
it is so good to see that you dont have any problem.
Last edited by [-hh] on Fri Aug 11, 2017 3:08 pm, edited 2 times in total.
shiftLock happens

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9386
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Images in Livecode

Post by richmond62 » Fri Aug 11, 2017 2:53 pm

? Problem ?

Some people take themselves and their failings far, far too seriously.

Life is to be enjoyed & Klaus and I have a good thing going that has been going on for years :D

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am
Location: Australia

Re: Images in Livecode

Post by bidgeeman » Fri Aug 11, 2017 2:54 pm

I took a brief look and it seemed to process the bitmap effect a lot faster than I have experienced. I'll take another look in the morning.
Don't worry...I always make a fool of myself :) It makes you more human ;)

Bidge

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Images in Livecode

Post by Klaus » Fri Aug 11, 2017 2:56 pm

richmond62 wrote:It's not that simple: I just made a fool of myself in front of Klaus Nomi (whoops, Mayer)...
And again! Come on, my name is even a valid english word... 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9386
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Images in Livecode

Post by richmond62 » Fri Aug 11, 2017 3:04 pm

Messing around with the RGB levels of an image can produce great effects.
TINTER2.png
Last edited by richmond62 on Fri Aug 11, 2017 5:03 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9386
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Images in Livecode

Post by richmond62 » Fri Aug 11, 2017 3:06 pm

And again!

Rishmond
is very shorry, and begsh forgiveness. :mrgreen:

Mind you: Klaus Nomi WAS a fantastic musician.
Last edited by richmond62 on Fri Aug 11, 2017 3:15 pm, edited 1 time in total.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Images in Livecode

Post by Klaus » Fri Aug 11, 2017 3:14 pm

richmond62 wrote:
And again!

Rishmond
is very shorry, and begsh forgiveness.
Thou shalt be forgiven!
richmond62 wrote:Mind you: Klaus Nomi[/b] WAS a fantastic musician.

Sure he was, but that's really not my cup of tea!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9386
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Images in Livecode

Post by richmond62 » Fri Aug 11, 2017 5:04 pm

TINTER3.png
Last edited by richmond62 on Fri Aug 11, 2017 6:56 pm, edited 1 time in total.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”