Hi everyone! Thanks for the comments, I don't create a repository yet because, in this first version, I just wanted to try if it was possible, so only create a Form subclass and add three methods.
Form subclass: #ImageForm
instanceVariableNames: 'mode'
classVariableNames: ''
package: ���SmallImage'
������>
+ aImage
"add two image and return a new ImageForm"
|aImageResult|
aImageResult := self deepCopy.
0 to: self width do:[:x| 0 to: self height
do:[:y|
|aPoint aColorA aColorB|
aPoint := (Point x: x y: y).
aColorA := aImageResult colorAt: aPoint.
aColorB := aImage colorAt: aPoint.
aImageResult colorAt: aPoint put: aColorA + aColorB. ]].
^ aImageResult
���->
show: anTitle
"Show a image in a window, scale the image to 500"
|im|
im := (ImageMorph withForm: (self scaledIntoFormOfSize:500) ).
im withSnapshotBorder.
im borderWidth: 5.
im color: (Color gray).
im openInWindowLabeled: (anTitle,' | mode: ', self mode asLowercase, '| ', self shape).
-���>
The first problem I found was the class Form return 'Form new' and not 'self class new' so I had to create two class method (in ImageForm):
newFrom: aForm mode: aMode
"create an ImageForm from to a Form object."
| aImage|
���aImage := self new.
���aImage copyFrom: aForm.
���aImage mode: aMode.
���^ aImage.
���>
open:��aFileName
���Open a image.���
| aImage aForm|
��aForm := ImageReadWriter formFromFileNamed: aFileName.
���aImage := self newFrom: aForm mode: ���ARGB���.
���^ aImage.
���>
I think that the methods (+ and show) should be directly in the class Form but I didn't want to change the original. If you think it's okay, I can continue working and this week upload to github with their respective tests.
P.S. sorry for my limited English.