Re: [Newbies] Coloring images with transparant parts

2008-11-22 Thread Matthias Korn
Hi Bert,

I have quite a hard time understanding how to use color maps. And I
really did not find any helpful documentation on them for Squeak.

One example I found in the image is in BitBlt classexampleColorMap.
But I don't know how to use it with a Form/BitBlt, well, and what the
heck they are actually doing there...
In most occasions they used the Bitmap class instead of ColorMap and I
couldn't find anything to convert.

Could you provide a simple code example on how to modify the color
map of a Form? Or any other pointers

Thanks a lot,
Matthias


Am Sat, 22 Nov 2008 01:58:33 +0100
schrieb Bert Freudenberg [EMAIL PROTECTED]:

 On 22.11.2008, at 01:15, Matthias Korn wrote:
 
  Hi,
 
  thanks for your hints. I also found ColorFormreplaceColor:with:  
  which
  does what you describe. But it is unfortunately not what I was
  looking for. I wasn't very clear in my original post:
 
  I (now) have a gray-scale image which I want to colorize, that is I
  want to change the hue of the image and not just replace a color
  with another (or floodfill for that matter).
 
  Hope you guys have some ideas. I tried searching with the Method  
  Finder,
  but my poor english didn't take me very far.
 
 
 Use a color map. Your grayscale image could be 8 bits, so with a 256  
 entries palette you can map that to any color(s) you want. Color
 maps are used in ColorForm, or directly with BitBlt.
 
 - Bert -
 
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners


-- 
Matthias Korn
Institut für Wirtschaftsinformatik
Fachbereich 5 
Universität Siegen
Telefon: +49 (0) 271 / 23 67 660
Mobil: +49 (0) 176 / 700 17 17 8
Uni: +49 (0) 271/ 740 - 3382
eMail: [EMAIL PROTECTED]
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Coloring images with transparant parts

2008-11-22 Thread Bert Freudenberg

Off the top of my head, this should make a nice rainbow palette:

anArray := (1 to: 256) collect:
[:i | Color h: i*360/256 s: 1 v: 1].
someColorForm colors: anArray.

So basically the color map is simply an array of Colors.

- Bert -

On 22.11.2008, at 13:07, Matthias Korn wrote:


Hi Bert,

I have quite a hard time understanding how to use color maps. And I
really did not find any helpful documentation on them for Squeak.

One example I found in the image is in BitBlt classexampleColorMap.
But I don't know how to use it with a Form/BitBlt, well, and what the
heck they are actually doing there...
In most occasions they used the Bitmap class instead of ColorMap and I
couldn't find anything to convert.

Could you provide a simple code example on how to modify the color
map of a Form? Or any other pointers

Thanks a lot,
Matthias


Am Sat, 22 Nov 2008 01:58:33 +0100
schrieb Bert Freudenberg [EMAIL PROTECTED]:


On 22.11.2008, at 01:15, Matthias Korn wrote:


Hi,

thanks for your hints. I also found ColorFormreplaceColor:with:
which
does what you describe. But it is unfortunately not what I was
looking for. I wasn't very clear in my original post:

I (now) have a gray-scale image which I want to colorize, that is I
want to change the hue of the image and not just replace a color
with another (or floodfill for that matter).

Hope you guys have some ideas. I tried searching with the Method
Finder,
but my poor english didn't take me very far.



Use a color map. Your grayscale image could be 8 bits, so with a 256
entries palette you can map that to any color(s) you want. Color
maps are used in ColorForm, or directly with BitBlt.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners



--
Matthias Korn
Institut für Wirtschaftsinformatik
Fachbereich 5
Universität Siegen
Telefon: +49 (0) 271 / 23 67 660
Mobil: +49 (0) 176 / 700 17 17 8
Uni: +49 (0) 271/ 740 - 3382
eMail: [EMAIL PROTECTED]
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Coloring images with transparant parts

2008-11-21 Thread Matthias Korn
Hi,

thanks for your hints. I also found ColorFormreplaceColor:with: which
does what you describe. But it is unfortunately not what I was looking
for. I wasn't very clear in my original post:

I (now) have a gray-scale image which I want to colorize, that is I
want to change the hue of the image and not just replace a color with
another (or floodfill for that matter).

Hope you guys have some ideas. I tried searching with the Method Finder,
but my poor english didn't take me very far.

Thanks a lot.
Matthias


Am Tue, 18 Nov 2008 15:08:27 +0100
schrieb Matthias Korn [EMAIL PROTECTED]:

 Hi all,
 
 I have a .png or .gif image (e.g. an ImageMorph) with transparent
 parts (e.g. a circle where the outer part is transparent). I now want
 to have this one image and color it programmatically with other
 colors (e.g. the circle appearing in slight red, green, blue ...).
 
 Is this possible to do with Squeak/Morphic? How?
 
 Thanks,
 Matthias
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners


-- 
Matthias Korn
Institut für Wirtschaftsinformatik
Fachbereich 5 
Universität Siegen
Telefon: +49 (0) 271 / 23 67 660
Mobil: +49 (0) 176 / 700 17 17 8
Uni: +49 (0) 271/ 740 - 3382
eMail: [EMAIL PROTECTED]
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Coloring images with transparant parts

2008-11-21 Thread Bert Freudenberg

On 22.11.2008, at 01:15, Matthias Korn wrote:


Hi,

thanks for your hints. I also found ColorFormreplaceColor:with:  
which

does what you describe. But it is unfortunately not what I was looking
for. I wasn't very clear in my original post:

I (now) have a gray-scale image which I want to colorize, that is I
want to change the hue of the image and not just replace a color with
another (or floodfill for that matter).

Hope you guys have some ideas. I tried searching with the Method  
Finder,

but my poor english didn't take me very far.



Use a color map. Your grayscale image could be 8 bits, so with a 256  
entries palette you can map that to any color(s) you want. Color maps  
are used in ColorForm, or directly with BitBlt.


- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Coloring images with transparant parts

2008-11-18 Thread Matthias Korn
Hi all,

I have a .png or .gif image (e.g. an ImageMorph) with transparent parts
(e.g. a circle where the outer part is transparent). I now want to have
this one image and color it programmatically with other colors (e.g. the
circle appearing in slight red, green, blue ...).

Is this possible to do with Squeak/Morphic? How?

Thanks,
Matthias
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Coloring images with transparant parts

2008-11-18 Thread Matthias Berth
Hi,

I know it is possible manually, using the paint box. I guess you could
fill using a transparent color. I would open the Method finder and
search for fill or floodfill. Don't have a squeak image in front of me
now, sorry.

HTH

Matthias

On Tue, Nov 18, 2008 at 3:08 PM, Matthias Korn
[EMAIL PROTECTED] wrote:
 Hi all,

 I have a .png or .gif image (e.g. an ImageMorph) with transparent parts
 (e.g. a circle where the outer part is transparent). I now want to have
 this one image and color it programmatically with other colors (e.g. the
 circle appearing in slight red, green, blue ...).

 Is this possible to do with Squeak/Morphic? How?

 Thanks,
 Matthias
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Coloring images with transparant parts

2008-11-18 Thread K. K. Subramaniam
On Tuesday 18 Nov 2008 7:38:27 pm Matthias Korn wrote:
 I have a .png or .gif image (e.g. an ImageMorph) with transparent parts
 (e.g. a circle where the outer part is transparent). I now want to have
 this one image and color it programmatically with other colors (e.g. the
 circle appearing in slight red, green, blue ...).
Take a look at SketchMorphrecolorPixelsOfColor: method. Essentially, you 
will have to make a new sketch by replacing colors in the color map of the 
sketch's form.

HTH .. Subbu
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners