RE: lingo-l get and set pixel.

2004-07-16 Thread Johan Verhoeven
same here.. with some thinking and tweeking you can do a wide variety of IL effects 
which are fast enough to use in realtime. Some very good examples on copypixel effect 
to be found at the lingo workshop:

http://www.lingoworkshop.com/code/imageFX.php

J.

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Alex da Franca
Verzonden: donderdag 15 juli 2004 21:10
Aan: [EMAIL PROTECTED]
Onderwerp: Re: lingo-l get and set pixel.


At 20:36 Uhr +0300 15.07.2004, thor wrote:

I am not sure what you mean by ink modes in copypixels.
Any examples?

it depends on what you're after with the:

At 13:47 Uhr +0100 14.07.2004, thor wrote:
rgbval = member(firstImg).image.getPixel(xx, yy)
   -- some calculations here and then
   member(secondImg).image.setPixel(xx,yy, newrgbval)


'-- some calculations here and then'

the simplest example would be copying a black 
image with reverse ink to reverse the image.
but you can also isolate colors with not reverse 
ink or achieve other results when using different 
inkmodes after another.
you can also desturate by copyPixeling into a 
#grayscale image or posterize by copypixeling 
into an 8 bit image with a custom palette.
there is so much possible in director since the 
introduction of IL, that it is for me the top 
feature, which was ever added to director. I 
can't imagine working a single day without an IL 
operation.


-- 

   |||
a¿ex
  --

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]


RE: lingo-l get and set pixel.

2004-07-15 Thread Thomas Higgins
 I am not sure what you mean by ink modes in copypixels.
 Any examples?

Here ya go:

destImg.copyPixels(srcImage,destRect,srcRect,[#ink: 36])

The above applies ink 36 (bgtrans) to the copyPixels operation, there are
many options you can use here (blend levels, masking options, and more).
This one is actually in the documentation! To be safe, I checked the MX docs
before saying that last bit... ;) 

Cheers,
Tom Higgins
Product Manager - Director Team
Macromedia

... 
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]


Re: lingo-l get and set pixel.

2004-07-15 Thread Alex da Franca
At 20:36 Uhr +0300 15.07.2004, thor wrote:
I am not sure what you mean by ink modes in copypixels.
Any examples?
it depends on what you're after with the:
At 13:47 Uhr +0100 14.07.2004, thor wrote:
rgbval = member(firstImg).image.getPixel(xx, yy)
-- some calculations here and then
member(secondImg).image.setPixel(xx,yy, newrgbval)

'-- some calculations here and then'
the simplest example would be copying a black 
image with reverse ink to reverse the image.
but you can also isolate colors with not reverse 
ink or achieve other results when using different 
inkmodes after another.
you can also desturate by copyPixeling into a 
#grayscale image or posterize by copypixeling 
into an 8 bit image with a custom palette.
there is so much possible in director since the 
introduction of IL, that it is for me the top 
feature, which was ever added to director. I 
can't imagine working a single day without an IL 
operation.

--
  |||
a¿ex
 --
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo.  Thanks!]


Re: lingo-l get and set pixel

2004-07-14 Thread Christoffer Enedahl

I am using this code similar to this :
repeat with xx = 1 to 450
repeat with yy = 1 to 400
rgbval = member(firstImg).image.getPixel(xx, yy)
-- some calculations here and then
member(secondImg).image.setPixel(xx,yy, newrgbval)
end repeat
end repeat
This is all working fine, except how slow it is.

It helps to cache slow stuff. like getting a member is slow.
And getPixel and setPixel is slow aswell.
for normal image copy stuff, check copyPixels in the manual, and some inks 
can be useful.
if you need to work down at pixellevel I would recode the loop something 
like this:

vImg1 = member(firstImg).image
vImg2 = member(secondImg).image
repeat with xx = 1 to 450
repeat with yy = 1 to 400
rgbval = vImg1.getPixel(xx,yy)
-- some calculations here and then
vImg2.setPixel(xx,yy, rgbval)
end repeat
end repeat
HTH/Christoffer 

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo.  Thanks!]


Re: lingo-l get and set pixel

2004-07-14 Thread Berndt Garbotz
Hi,
dunno how much it slows, but use an instance e.g.
myImage =  member(firstImg).image
repeat with xx = 1 to 450
   repeat with yy = 1 to 400
   rgbval = myImage.getPixel(xx, yy)
   -- some calculations here and then
   myImage.setPixel(xx,yy, newrgbval)
   end repeat
end repeat
Hth
Berndt
Hi List
I am reading an image and drawing some of the pixels
onto another image cast member.
I am using this code similar to this :
repeat with xx = 1 to 450
repeat with yy = 1 to 400
rgbval = member(firstImg).image.getPixel(xx, yy)
-- some calculations here and then
member(secondImg).image.setPixel(xx,yy, newrgbval)
end repeat
end repeat
This is all working fine, except how slow it is.
Do you have any tips on how to fasten this process?
(is there any way of analysing an image object quicker than this
with imaging lingo?)
thanks for all answers
t
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, 
email [EMAIL PROTECTED]  (Problems, email 
[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
programming Lingo.  Thanks!]



[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo.  Thanks!]


RE: lingo-l get and set pixel

2004-07-14 Thread Johan Verhoeven
What are you exactly trying to do? some things can better be done with copypixels and 
some other creative use of imaging lingo features. Get and set pixel is very slow. 
Caching the image objects will speed things up, but not to such an extend that it will 
enable you to do things realtime.

J.

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Christoffer Enedahl
Verzonden: woensdag 14 juli 2004 13:55
Aan: [EMAIL PROTECTED]
Onderwerp: Re: lingo-l get and set pixel



I am using this code similar to this :

repeat with xx = 1 to 450
 repeat with yy = 1 to 400
 rgbval = member(firstImg).image.getPixel(xx, yy)
 -- some calculations here and then
 member(secondImg).image.setPixel(xx,yy, newrgbval)
 end repeat
end repeat

This is all working fine, except how slow it is.


It helps to cache slow stuff. like getting a member is slow.
And getPixel and setPixel is slow aswell.

for normal image copy stuff, check copyPixels in the manual, and some inks 
can be useful.
if you need to work down at pixellevel I would recode the loop something 
like this:

vImg1 = member(firstImg).image
vImg2 = member(secondImg).image
repeat with xx = 1 to 450
 repeat with yy = 1 to 400
 rgbval = vImg1.getPixel(xx,yy)
 -- some calculations here and then
 vImg2.setPixel(xx,yy, rgbval)
 end repeat
end repeat

HTH/Christoffer 


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]


Re: lingo-l get and set pixel

2004-07-14 Thread Alex da Franca
At 13:55 Uhr +0200 14.07.2004, Christoffer Enedahl wrote:
I am using this code similar to this :
repeat with xx = 1 to 450
repeat with yy = 1 to 400
rgbval = member(firstImg).image.getPixel(xx, yy)
-- some calculations here and then
member(secondImg).image.setPixel(xx,yy, newrgbval)
end repeat
end repeat
This is all working fine, except how slow it is.

It helps to cache slow stuff. like getting a member is slow.
And getPixel and setPixel is slow aswell.
for normal image copy stuff, check copyPixels in 
the manual, and some inks can be useful.
if you need to work down at pixellevel I would 
recode the loop something like this:

vImg1 = member(firstImg).image
vImg2 = member(secondImg).image
repeat with xx = 1 to 450
repeat with yy = 1 to 400
rgbval = vImg1.getPixel(xx,yy)
-- some calculations here and then
vImg2.setPixel(xx,yy, rgbval)
end repeat
end repeat

although this will speed up the handler a little 
bit, it doesn't do the great benefit you're 
expecting, since image objects from a member get 
passed by reference rather than by value.
so storing member(firstImg).image in the 
variable vImg1 will only work as kind of 
'shortcut', but anyway it needs to dereference 
the image data and act (and actualize) the image 
data in the members image.
this is SLOW.
as a rule of thumb, every time you do more than 
one operation on an imageobject always make sure 
you work on a copy of the imageobject in RAM and 
NOT on a reference to a members image.

modifying the above code to:
vImg1 = member(firstImg).image.duplicate()
vImg2 = member(secondImg).image.duplicate()
repeat with xx = 1 to 450
repeat with yy = 1 to 400
rgbval = vImg1.getPixel(xx,yy)
-- some calculations here and then
vImg2.setPixel(xx,yy, rgbval)
end repeat
end repeat
member(secondImg).image = vImg2
these *little but very important* changes should speed up the thing noticeably.
nonetheless acting on an image object on a per 
pixel basis will always remain slow.
depending on what you're after, there may be 
other techniques (using inkmodes with copyPixels 
for example), wjhich are WAY FASTER !

--
  |||
a¿ex
 --
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo.  Thanks!]