hi jerome,
i'd like to have different images in a project and change their alpha property dynamically using scripts.
since i can't find the color category of an image in the viewer i don't know how to access its alpha property.
thanks for your time!
á.
On Thu, Apr 23, 2009 at 3:21 AM, Jerome Peace peace_the_dreamer@yahoo.com wrote:
--- On Wed, 4/22/09, Angel Arias futuhat@gmail.com wrote:
From: Angel Arias futuhat@gmail.com Subject: [Etoys] alpha property To: etoys@lists.laptop.org Date: Wednesday, April 22, 2009, 8:24 PM hiya all!
is it possible to alter the alpha value of an imported image [jpg, png, etc]?
The short answer is yes.
The long answer depends on what you want to do.
Alter how?
thanks a lot!
á ;-) _______________________________________________ Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
On 23.04.2009, at 09:41, Angel Arias wrote:
i'd like to have different images in a project and change their alpha property dynamically using scripts.
since i can't find the color category of an image in the viewer i don't know how to access its alpha property.
Using Etoys tiles you can only hide and show an image completely, not adjust its transparency.
- Bert -
On 2009-04-23 13:24, Bert Freudenberg wrote:
On 23.04.2009, at 09:41, Angel Arias wrote:
i'd like to have different images in a project and change their alpha property dynamically using scripts.
since i can't find the color category of an image in the viewer i don't know how to access its alpha property.
Using Etoys tiles you can only hide and show an image completely, not adjust its transparency.
- Bert -
You can do image adjustments in a very slow way using a turtle to read each pixel and adjust the color and draw it another place :-) I did a project that does that here: http://wiki.laptop.org/images/8/8a/ColorReadingAndWriting-17.xo
To add alpha channel would not be hard, but this project is more prof of concept and it is slllllooooowwww
Karl
--- On Thu, 4/23/09, Angel Arias futuhat@gmail.com wrote:
From: Angel Arias futuhat@gmail.com Subject: Re: [Etoys] alpha property To: peace_the_dreamer@yahoo.com, etoys@lists.laptop.org Date: Thursday, April 23, 2009, 3:41 AM hi jerome,
i'd like to have different images in a project and change their alpha property dynamically using scripts.
since i can't find the color category of an image in the viewer i don't know how to access its alpha property.
thanks for your time!
Hmm. Etoys taught me how to use squeak. Basicly the Etoys "safe" environment taught me that it was easier to get things done if I focused on using the more dangerous but less restrictive environment it was written in.
Karl is right about the restrictions of the tiling system. While I found some easy ways to modify a picture that comes from a .gif file. I couldn't find a good way to do it in the tile scripting system.
Its a good ability to want. So I think you raised a good question. You've just thought of something other's haven't addressed. I intend to play with is some more. If I come up with something I will let you know.
Yours in curiosity and service, --Jerome Peace
On Thu, Apr 23, 2009 at 3:21 AM, Jerome Peace peace_the_dreamer@yahoo.com wrote:
--- On Wed, 4/22/09, Angel Arias
futuhat@gmail.com wrote:
From: Angel Arias futuhat@gmail.com Subject: [Etoys] alpha property To: etoys@lists.laptop.org Date: Wednesday, April 22, 2009, 8:24 PM hiya all!
is it possible to alter the alpha value of an
imported
image [jpg, png, etc]?
The short answer is yes.
The long answer depends on what you want to do.
Alter how?
thanks a lot!
á ;-) _______________________________________________ Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
On 2009-04-23 22:40, Jerome Peace wrote:
--- On Thu, 4/23/09, Angel Ariasfutuhat@gmail.com wrote:
From: Angel Ariasfutuhat@gmail.com Subject: Re: [Etoys] alpha property To: peace_the_dreamer@yahoo.com, etoys@lists.laptop.org Date: Thursday, April 23, 2009, 3:41 AM hi jerome,
i'd like to have different images in a project and change their alpha property dynamically using scripts.
since i can't find the color category of an image in the viewer i don't know how to access its alpha property.
thanks for your time!
Hmm. Etoys taught me how to use squeak. Basicly the Etoys "safe" environment taught me that it was easier to get things done if I focused on using the more dangerous but less restrictive environment it was written in.
Karl is right about the restrictions of the tiling system. While I found some easy ways to modify a picture that comes from a .gif file. I couldn't find a good way to do it in the tile scripting system.
Its a good ability to want. So I think you raised a good question. You've just thought of something other's haven't addressed. I intend to play with is some more. If I come up with something I will let you know.
Here is a good starting point. http://wiki.squeak.org/squeak/2411 I'm not sure if a alpha filter is implemented in this package.
I think this would be a nice addition to the Etoys image as well, with some needed integration with Etoys.
Karl
Yours in curiosity and service, --Jerome Peace
On Thu, Apr 23, 2009 at 3:21 AM, Jerome Peace peace_the_dreamer@yahoo.com wrote:
--- On Wed, 4/22/09, Angel Arias
futuhat@gmail.com wrote:
From: Angel Ariasfutuhat@gmail.com Subject: [Etoys] alpha property To: etoys@lists.laptop.org Date: Wednesday, April 22, 2009, 8:24 PM hiya all!
is it possible to alter the alpha value of an
imported
image [jpg, png, etc]?
The short answer is yes.
The long answer depends on what you want to do.
Alter how?
thanks a lot!
á ;-) _______________________________________________ Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
Hi Karl,
--- On Fri, 4/24/09, Karl Ramberg karlramberg@gmail.com wrote:
From: Karl Ramberg karlramberg@gmail.com Subject: Re: [Etoys] alpha property
I think this would be a nice addition to the Etoys image as well, with some needed integration with Etoys.
It is the etoy integration that is the problem.
Look at how etoys handles things.
Etoys has hobbled itself to avoid some bugs with translucency. First it comes up default with a 16 bit display. At that depth no translucency can be shown. Switching to 32 bit depth can correct that.
But it doesn't help. Sketch morphs have slots for the original form. and a rotated form. The last is the original form processed by the rotation/stretching/scaling that has be done to the sketch by the handles. It is the rotated form that actually gets displayed. In the processing the form is forced to be depth 16. So you will never see translucent sketches even if the base graphic and original form are translucent. This is what stumped me.
Work arounds are hard to come by. An ImageMorph is the other way to hold a form for display. It was designed to be simple and does not allow direct scaling. Etoys makes it very hard to get an ImageMorph and has no natural way for putting an image into one.
That leaves putting an image in a BitmapFill. This might work but not from tiles.
And it is questionable to put time into development when the mindset is hide faults by hobbling the languages abilities.
As you might be hearing from my tone, I am somewhat disappointed.
Yours in curiosity and service, --Jerome Peace
On 2009-04-24 23:13, Jerome Peace wrote:
Hi Karl,
--- On Fri, 4/24/09, Karl Rambergkarlramberg@gmail.com wrote:
From: Karl Rambergkarlramberg@gmail.com Subject: Re: [Etoys] alpha property
I think this would be a nice addition to the Etoys image as well, with some needed integration with Etoys.
It is the etoy integration that is the problem.
Look at how etoys handles things.
Etoys has hobbled itself to avoid some bugs with translucency. First it comes up default with a 16 bit display. At that depth no translucency can be shown. Switching to 32 bit depth can correct that.
But it doesn't help. Sketch morphs have slots for the original form. and a rotated form. The last is the original form processed by the rotation/stretching/scaling that has be done to the sketch by the handles. It is the rotated form that actually gets displayed. In the processing the form is forced to be depth 16. So you will never see translucent sketches even if the base graphic and original form are translucent. This is what stumped me.
Work arounds are hard to come by. An ImageMorph is the other way to hold a form for display. It was designed to be simple and does not allow direct scaling. Etoys makes it very hard to get an ImageMorph and has no natural way for putting an image into one.
That leaves putting an image in a BitmapFill. This might work but not from tiles.
And it is questionable to put time into development when the mindset is hide faults by hobbling the languages abilities.
As you might be hearing from my tone, I am somewhat disappointed.
Yours in curiosity and service, --Jerome Peace
Uh, I did not know this... Well, I guess it should be posted as a bug/enhancement project on the bug tracker.
Karl
On 25.04.2009, at 09:38, Karl Ramberg wrote:
On 2009-04-24 23:13, Jerome Peace wrote:
Hi Karl,
--- On Fri, 4/24/09, Karl Ramberg karlramberg@gmail.com wrote:
From: Karl Ramberg karlramberg@gmail.com Subject: Re: [Etoys] alpha property
I think this would be a nice addition to the Etoys image as well, with some needed integration with Etoys.
It is the etoy integration that is the problem.
Look at how etoys handles things.
Etoys has hobbled itself to avoid some bugs with translucency. First it comes up default with a 16 bit display. At that depth no translucency can be shown. Switching to 32 bit depth can correct that.
But it doesn't help. Sketch morphs have slots for the original form. and a rotated form. The last is the original form processed by the rotation/stretching/ scaling that has be done to the sketch by the handles. It is the rotated form that actually gets displayed. In the processing the form is forced to be depth 16. So you will never see translucent sketches even if the base graphic and original form are translucent. This is what stumped me.
Work arounds are hard to come by. An ImageMorph is the other way to hold a form for display. It was designed to be simple and does not allow direct scaling. Etoys makes it very hard to get an ImageMorph and has no natural way for putting an image into one.
That leaves putting an image in a BitmapFill. This might work but not from tiles.
And it is questionable to put time into development when the mindset is hide faults by hobbling the languages abilities.
As you might be hearing from my tone, I am somewhat disappointed.
Yours in curiosity and service, --Jerome Peace
Uh, I did not know this... Well, I guess it should be posted as a bug/enhancement project on the bug tracker.
It's a trade-off. At 16 bpp we have to shove around only have as much data as in 32 bpp. Our painting tools do not support alpha transparency. If you use translucency and gradients, powerful tiles like color-sees do not work as well. That's also the reason why we don't smooth rotated sketches, because it alters the colors.
Now that said, we actually do support alpha transparency in 16 bpp. You can take an ellipse and set its alpha to 50 and it works. One could do the same for images. Perhaps even more powerful would be a special kind of holder that would adjust all its childrens' transparency. That way, any object could be made translucent by embedding.
- Bert -
Hi Bert, Hi Karl,
--- On Sat, 4/25/09, Bert Freudenberg bert@freudenbergs.de wrote:
From: Bert Freudenberg bert@freudenbergs.de Subject: Re: [Etoys] alpha property replied:
<lots snipped>
It's a trade-off. At 16 bpp we have to shove around only have as much data as in 32 bpp. Our painting tools do not support alpha transparency. If you use translucency and gradients, powerful tiles like color-sees do not work as well. That's also the reason why we don't smooth rotated sketches, because it alters the colors.
Now that said, we actually do support alpha transparency in 16 bpp.
That surprised me. And good news.
This means that you can get a transparent picture. You need to start off with a ColorForm (All gif images are read in as such.) Put it somewhere you can get at. Such as a BitmapFill form or ImageMorph image. Sketches are aggressively opaque.
myColorForm colors: ( myColorForm colors collect: [ :each | each alpha: myAlpha. )
myAlpha can come from an Imagemorphs color ivar alpha. For Morphs with bitmapFills you need to use a sliders numeric value suitably scaled between 0 and 1 inclusive. In my experimenting I found that coloring most morphs would remove its bitmapFill to give it a solid color.
I have experimented with a gif generated picture as a bitMapfill and found the above technique works. Albeit somewhat fragily because the fill can be removed out from under me by other user interations. Then I will get a debug box or other errors.
I have not tried to do this with tiles.
One could do the same for images. Perhaps even more powerful would be a special kind of holder that would adjust all its childrens' transparency. That way, any object could be made translucent by embedding.
Hmmm. Now there is an idea generator.
Thanks Bert, knowledgeable and constructive as usual.
Yours in curiosity and service, --Jerome Peace
On Thursday 23 April 2009 1:11:11 pm Angel Arias wrote:
hi jerome,
i'd like to have different images in a project and change their alpha property dynamically using scripts.
You could use a overlay rectangle with zero border and same color as the background of the image and then vary its alpha in the script.
If the image's background is not uniform, this hack will not work :-(. In this case, you could create images at various alpha levels using an external program and put them into a holder. Pick the one you need as a costume.
HTH .. Subbu
etoys-dev@lists.squeakfoundation.org