Hello, In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly rotated or scaled when they contain alpha transparency. In the example bellow with the joined bitmap, the alpha gray color are rendered darker when the imagemorph is scaled or rotated. Sqeak does not suffer this problem | dir morph transform form| dir := FileSystem disk workingDirectory parent. morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') fullName) asMorph. transform := TransformationMorph new asFlexOf: morph. transform smoothingOn ; angle: Float pi / 3; scale: 1. transform openInWorld Thanks Hilaire -- Dr. Geo http://drgeo.eu
On Nov 20, 2013, at 4:54 PM, Hilaire Fernandes <hilaire.fernandes@gmail.com> wrote:
Hello,
In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly rotated or scaled when they contain alpha transparency.
In the example bellow with the joined bitmap, the alpha gray color are rendered darker when the imagemorph is scaled or rotated.
Sqeak does not suffer this problem
hilaire may be you should have a look at the changes made in the graphics package of squeak to identify the change. We should have more tests. Stef
| dir morph transform form| dir := FileSystem disk workingDirectory parent. morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') fullName) asMorph. transform := TransformationMorph new asFlexOf: morph. transform smoothingOn ; angle: Float pi / 3; scale: 1. transform openInWorld
Thanks
Hilaire
-- Dr. Geo http://drgeo.eu <bubble.png>
Le 21/11/2013 08:21, Stéphane Ducasse a écrit :
On Nov 20, 2013, at 4:54 PM, Hilaire Fernandes <hilaire.fernandes@gmail.com> wrote:
Hello,
In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly rotated or scaled when they contain alpha transparency.
In the example bellow with the joined bitmap, the alpha gray color are rendered darker when the imagemorph is scaled or rotated.
Sqeak does not suffer this problem
hilaire may be you should have a look at the changes made in the graphics package
I took at look on the list, did not find anything yet Hilaire
of squeak to identify the change. We should have more tests.
Stef
| dir morph transform form| dir := FileSystem disk workingDirectory parent. morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') fullName) asMorph. transform := TransformationMorph new asFlexOf: morph. transform smoothingOn ; angle: Float pi / 3; scale: 1. transform openInWorld
Thanks
Hilaire
-- Dr. Geo http://drgeo.eu <bubble.png>
-- Dr. Geo http://drgeo.eu
Le 21/11/2013 21:27, Hilaire Fernandes a écrit :
Le 21/11/2013 08:21, Stéphane Ducasse a écrit :
On Nov 20, 2013, at 4:54 PM, Hilaire Fernandes <hilaire.fernandes@gmail.com> wrote:
Hello,
In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly rotated or scaled when they contain alpha transparency.
In the example bellow with the joined bitmap, the alpha gray color are rendered darker when the imagemorph is scaled or rotated.
Sqeak does not suffer this problem
hilaire may be you should have a look at the changes made in the graphics package
I took at look on the list, did not find anything yet
Oh, look like an old fix can partially make it http://forum.world.st/ENH-Translucent-images-in-8-and-16-bit-screen-resoluti... Joined .cs of this changes I don't understand this code, and I don't know its consequences on the all system. So someone should review it. Hilaire
Hilaire
of squeak to identify the change. We should have more tests.
Stef
| dir morph transform form| dir := FileSystem disk workingDirectory parent. morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') fullName) asMorph. transform := TransformationMorph new asFlexOf: morph. transform smoothingOn ; angle: Float pi / 3; scale: 1. transform openInWorld
Thanks
Hilaire
-- Dr. Geo http://drgeo.eu <bubble.png>
-- Dr. Geo http://drgeo.eu
On 21 November 2013 21:27, Hilaire Fernandes <hilaire.fernandes@gmail.com>wrote:
Le 21/11/2013 08:21, Stéphane Ducasse a écrit :
On Nov 20, 2013, at 4:54 PM, Hilaire Fernandes <
hilaire.fernandes@gmail.com> wrote:
Hello,
In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly rotated or scaled when they contain alpha transparency.
In the example bellow with the joined bitmap, the alpha gray color are rendered darker when the imagemorph is scaled or rotated.
Sqeak does not suffer this problem
hilaire may be you should have a look at the changes made in the
graphics package
I took at look on the list, did not find anything yet
not directly, right. But since symptoms are similar, i think this is most probably the same case. (and your digging shown that we actually having separate rule for premultiplied alpha blend, which i could use for correctly transferring/blending cairo surface pixels in Forms)
Hilaire
of squeak to identify the change. We should have more tests.
Stef
| dir morph transform form| dir := FileSystem disk workingDirectory parent. morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') fullName) asMorph. transform := TransformationMorph new asFlexOf: morph. transform smoothingOn ; angle: Float pi / 3; scale: 1. transform openInWorld
Thanks
Hilaire
-- Dr. Geo http://drgeo.eu <bubble.png>
-- Dr. Geo http://drgeo.eu
-- Best regards, Igor Stasenko.
Yay, it works.. if i use: canvas image: surface asForm at: bounds origin sourceRect: (0@0 extent: surface extent ) rule: 34. instead of canvas translucentImage: surface asForm at: bounds origin. hmm.. i just don't understand why: image: aForm at: aPoint sourceRect: sourceRect rule: rule "Note: The public use of this protocol is deprecated. It will become private. Nobody in the outside world must assume that a thing like a combination rule has any specific effect." why it is considered private? i wanna blend my form with another using specific rule, and this is the only protocol available for that.. weird. (Sorry for derailing topic, but that problem was quite annoying to me, i will take more deeper look at a fix later , and reply separately ;) ) On 22 November 2013 00:54, Igor Stasenko <siguctua@gmail.com> wrote:
On 21 November 2013 21:27, Hilaire Fernandes <hilaire.fernandes@gmail.com>wrote:
Le 21/11/2013 08:21, Stéphane Ducasse a écrit :
On Nov 20, 2013, at 4:54 PM, Hilaire Fernandes <
hilaire.fernandes@gmail.com> wrote:
Hello,
In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly rotated or scaled when they contain alpha transparency.
In the example bellow with the joined bitmap, the alpha gray color are rendered darker when the imagemorph is scaled or rotated.
Sqeak does not suffer this problem
hilaire may be you should have a look at the changes made in the
graphics package
I took at look on the list, did not find anything yet
not directly, right. But since symptoms are similar, i think this is most probably the same case. (and your digging shown that we actually having separate rule for premultiplied alpha blend, which i could use for correctly transferring/blending cairo surface pixels in Forms)
Hilaire
of squeak to identify the change. We should have more tests.
Stef
| dir morph transform form| dir := FileSystem disk workingDirectory parent. morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') fullName) asMorph. transform := TransformationMorph new asFlexOf: morph. transform smoothingOn ; angle: Float pi / 3; scale: 1. transform openInWorld
Thanks
Hilaire
-- Dr. Geo http://drgeo.eu <bubble.png>
-- Dr. Geo http://drgeo.eu
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.
The problem is really not related to PNG bitmap as the same issue can be exposed with simple, as in this example: | morph rectangle | rectangle := RectangleMorph new color: (Color red alpha: 0.5). morph := TransformationMorph new asFlexOf: rectangle. morph scale: 0.7. morph openInWorld In this example, the red appears darker once the rectangle is scaled. Is it something related to the Blit ? I reallz don't know where to look. Hilaire -- View this message in context: http://forum.world.st/Scaled-PNG-image-tp4723754p4723975.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
On 21 November 2013 14:22, hilaire <hilaire.fernandes@gmail.com> wrote:
The problem is really not related to PNG bitmap as the same issue can be exposed with simple, as in this example:
| morph rectangle | rectangle := RectangleMorph new color: (Color red alpha: 0.5). morph := TransformationMorph new asFlexOf: rectangle. morph scale: 0.7. morph openInWorld
In this example, the red appears darker once the rectangle is scaled.
Is it something related to the Blit ? I reallz don't know where to look.
no idea.. Except that while adopting cairo surfaces i also has odd transparency issues until i realized that cairo surface stores pixel data using premultiplied alpha format,e.g.: pixelColor = (R*A, G*A, B*A, A) while bitblt assumes it is (R,G,B,A)
Hilaire
-- View this message in context: http://forum.world.st/Scaled-PNG-image-tp4723754p4723975.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Best regards, Igor Stasenko.
Le 21/11/2013 16:44, Igor Stasenko a écrit :
Except that while adopting cairo surfaces i also has odd transparency issues until i realized that cairo surface stores pixel data using premultiplied alpha format,e.g.:
pixelColor = (R*A, G*A, B*A, A)
while bitblt assumes it is (R,G,B,A)
Should not be related, right? Hilaire -- Dr. Geo http://drgeo.eu
participants (4)
-
hilaire -
Hilaire Fernandes -
Igor Stasenko -
Stéphane Ducasse