<Screen Shot 2012-05-25 at 2.22.06 PM.png>I tried setting alpha to 50, but it didn't work, see script below.recolor| oldForm newForm old new avg |oldForm := ErnieRubberDuckie getGraphic.newForm := Form extent: oldForm extent depth: 16.0to: oldForm height - 1do: [:y | 0to: oldForm width - 1do: [:x |old := oldForm colorAt: x @ y.avg := old red + old green + old blue / 3.new := Colorr: old red * 0 + avgg: old green * 0 + avgb: old blue * 0 + avgalpha: 50.newForm colorAt: x @ y put: new]].self setGraphic: newFormOn Fri, May 25, 2012 at 7:59 AM, Bert Freudenberg <bert@freudenbergs.de> wrote:
On 25.05.2012, at 12:35, Steve Thomas wrote:
How can I loop through each pixel in an image and get their red,green,blue values?I also would like to be able to create a new image using those values (modified, for example set red=red*0.5)I know Karl did a great project Color Reading And Writing which I could use, but would like to introduce some of the kids to squeak.<PastedGraphic-10.png><PastedGraphic-11.png>- Bert -