Image Manipulation

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 421
Joined: Sun Feb 13, 2011 8:43 pm
Location: Seattle, USA

Re: Image Manipulation

Post by townsend » Sun Nov 13, 2011 4:54 pm

just to be sure, the "open file" snytax that I provided will work on all platforms!
Yes, aside from the text in the menus, open and everything else seems to works fine on Windows 7 and LC 4.6.4.

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Image Manipulation

Post by cbodell » Sun Nov 13, 2011 11:13 pm

I thought i had fixed the "revert to origional" problem, hmmm. Im havent got a chance to update quite yet. But i definitely will. Thanks for the updates friends.

I agree as well, it is fairly slow at imageData retrieval. I was wondering, is that becase it has to retrieve outside the environment, ie, through the actual file data? Or is that due to the charToNum & numToChar conversion process?

Lastly, has anyone gotten a chance to critique the weather effects, and mosaic tile patterns, or the dissipation effects and pixel drifts? Wondering how i did. I guess it'd be alot easier if the menus were readable. Will update when ive debugged! :lol:

Thanks alot,

Chris

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 421
Joined: Sun Feb 13, 2011 8:43 pm
Location: Seattle, USA

Re: Image Manipulation

Post by townsend » Mon Nov 14, 2011 1:04 am

Yes, Revert to Original does not seem to work. Also Filter Undo has the same problem. Just a blue image appears.

Mosaic works good, but takes a while. Some kind of spinner, or please wait indicator, would be nice.
Outline Edges is amazing!! Here look:
146 outline edges.jpeg
Weather Effects, Water Droplets does nothing. Frosty Flakes should be more dense.
Pixel, Random Grayscale, crashed on, " put random((tAmount)) into pHold".

Opening a photo takes about 4 seconds. Not too bad. Though it's a little odd, because the photo always appears in black and white, before full color is rendered. Looking forward to the next update.

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Image Manipulation

Post by cbodell » Wed Nov 16, 2011 4:56 am

Update for Photo Room - Better readability and updated menu items. Next for update ("Open File", "About Menu",& *Extra filters will be integrated)

Chris Bodell

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Image Manipulation

Post by cbodell » Sun Nov 20, 2011 9:07 pm

Update for Photo Room,

I've incorporate more filters and update menus. Some of the menu items weren't scripted with correct values. Also, some filters were distorting the image completely. Many have been fixed but there are still a few issues. Many of the filters overlay pixels in a wrapping effect. A Simple determination of pixel location in correspondence to the edges of the image would fix the problem, but there are so many filters, i have to track down individually which filters are problematic.

The Convolution filter has now been added with many effects, next update should have a 5x5 matrix, where ill add other effects. Water ripple effects will also be in the next update version, as well as more options/parameters for the reflection function. The skin detection function will be better adjusted for different skin tones. I also need to fix the red-eye reduction filter; since it is auto-detected, i need to adjust the function code. Several different methods of Grayscaling has been added, color-preservative, eye-corrected, median - min - max, & single-channel methods.

I have somewhat reverted to the original menu bar. Mac Users, please post if there are any issues with usability.

Any Ideas please post! *Have not fixed the "Open..." option for cross platform usability yet.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3222
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Image Manipulation

Post by bn » Mon Nov 21, 2011 12:20 am

Hi Chris

thank you for the update. I am on a Mac and changed the open menu. However it takes about 10 seconds for the first image to load. If you do a "lock screen" in the enableMenu handler in the card it is near instantaneous.

Other than that: too bad the revert to original is gone, I have to reload the image after an extensive effect. The way you did it in every menu was hard to maintain and debug. I suggest if you plan to restore the feature to make it a handler higher in the hierarchy which is called from the menus. I did change the non-working handler for the restore in the last version for the filter menu and it worked.

Code: Select all

 case "Revert to Origional"
         put the imageData of img "Image" into tData
         lock screen
         --         set the tZoom of img "Image" to the width of img "Image" & comma & the height of img "Image"
         --         set the itemDel to comma
         --         set the width of img "Image" to item 1 of the tOrigionalSize of img "Image"
         --         set the height of img "Image" to item 2 of the tOrigionalSize of img "Image"
         --         set the topleft of img "image" to the tTopLeft of img "Image"
         set the imageData of img "Image" to the tOrigionalData of img "Image"
         --         set the width of img "Image" to item 1 of the tZoom of img "Image"
         --         set the height of img "Image" to item 2 of the tZoom of img "Image"
         --         set the topleft of img "image" to the tTopLeft of img "Image"
         unlock screen
         set the tLastData of img "Image" to tData
         set the tPriorData of img "Image" to empty
         break
I just blocked the code and than it worked.

There are very nice effects but it is tedious to test them since you have to reload the original all the time.

Klaus' suggestion for a filter to open the files

Code: Select all

answer file "Select an Image File:" with (tName & "." & tDefault) with TYPE "|jpg,gif,png|" titled  "Photo Room"
works fine on a Mac. If it works on Windows also it would solve the problem of opening a file. The way it is now it is not useable on a Mac unless one goes into the code and disables the filter.

Kind regards

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3222
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Image Manipulation

Post by bn » Mon Nov 21, 2011 4:16 pm

Hi Chris,

filter sharpen -> neat sharpen throws an error for me.

repeated Reflections enlarge height of image

Kind regards

Bernd

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

Re: Image Manipulation

Post by Klaus » Mon Nov 21, 2011 6:28 pm

Hi guys,

I repeat it for the third time here on the forum:
My "Open..." script DOES work crossplatform on Mac and Windows! 8)


Best

Klaus

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Image Manipulation

Post by cbodell » Mon Nov 21, 2011 10:12 pm

Klaus,

I've just incorpated your script in the "Open..." menu item, hopefully i've done it correctly, works fine so far on Windows, i cant test on other platforms though. If you could have a look at the code on the new update, that would be great, i haven't used that syntax before, so i'm not sure if it's implemented correctly. Seems to be though! Thanks again, i've been meaning to get to that!

Bernd,

I'll have a look at that filter, if i remember correctly, it runs a convolution filter array. If so, may be an extra char in the item, ill have a look though.

As for the reflection, i had it resize the image for test reasons, but it seems to be preferred that the image dimensions remain so ill stick with that route. On the other hand, your last post, i havent got around to the "Open..." efficiency yet, but ill have that fixed for the next update. It's definitely incosiderate of the code, that problem arises for me at random times so ill fix that as well.

* I have coded 2 of the "Import" options, Form Clipboard & Screenshot
And i'm working on the "Revert" option, and Undo /Redo filter options.

Agnar Tonheim
Posts: 10
Joined: Sun Jan 25, 2009 3:27 pm

Re: Image Manipulation

Post by Agnar Tonheim » Mon Nov 21, 2011 11:42 pm

Hi !
Edit - Preferences gives an missing stack error... (modal stack "OdellB Image Preferences")

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3222
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Image Manipulation

Post by bn » Tue Nov 22, 2011 12:38 am

Hi Chris,

Code: Select all

  case "Redwood"
         get addFilter_ConvertColorScaleTestTest(the long id of img "Image","171,78,82")
         break
      case "Mahogany"
         get addFilter_ConvertColorScaleTestTest(the long id of img "Image","192,64,0")
         break
both "Redwood" and "Mahogany" throw an error, there is no "addFilter_ConvertColorScaleTestTest" handler in the card script, it seems to be a typo: changing it to "addFilter_ConvertColorScaleTest" works.

Kind regards

Bernd

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Image Manipulation

Post by cbodell » Tue Nov 22, 2011 2:39 am

Hi guys,

I have to create a preference pane. I might be able to have that in the next update, there probably wont be too many preferences :lol: but ill get onto that. Thanks for the update Bernd as well! Ill fix that typo.

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

Re: Image Manipulation

Post by Klaus » Wed Nov 23, 2011 4:57 pm

Hi Chris,

please copy this (tested and working) line and put it into your "Open..." handler and remove your line:
answer file "Select an Image File:" with (tName & "." & tDefault) with type "|jpg,jpeg,gif,png,bmp|" titled "Photo Room"

And please don't modify it unless you are REALLY sure it will work out allright! ;-)


Best

Klaus

cbodell
Posts: 61
Joined: Wed Nov 09, 2011 7:27 pm

Re: Image Manipulation

Post by cbodell » Wed Nov 23, 2011 8:44 pm

Oh good, ill stick that in there, thats somewhat what i had but does mac not support the labeled version, so users can swap image types?

Thanks Klaus

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5132
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Image Manipulation

Post by Mark » Wed Nov 23, 2011 9:55 pm

cb...

Do you mean this?

Code: Select all

answer file "Select a file..." with type "Some file|abc|ABC!" or type "Other file|xyz|XYZ!"
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “Rich Media”