BitmapData.applyFilter() bug on Windows target

Hello. It’s seems that BitmapData.applyFilter() works wrong.
Here is my code:

bd.applyFilter(
    bd,
    bd.rect,
    new Point(0, 0),
    new ColorMatrixFilter([
        2.00,	0.15,	-1.15,	0,	0,
        -0.60,	1.30,	0.35,	0,	0,
        0.58,	-1.65,	2.00,	0,	0,
        0,	0,	0,	1,	0
    ])
);

And the result (at the left original bitmap, at the right with applied filter):

Looks like value overflow.
Should I post this bug to the bugtracker or something?

Yep, that would be great – a full “Main.hx” for a sample would be awesome, too, thank you! :slight_smile:

Hi.

Main.hx here:

package;

import openfl.geom.Rectangle;
import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.display.Sprite;
import openfl.filters.ColorMatrixFilter;
import openfl.geom.Point;

class Main extends Sprite {
	
	public function new() {
		super();
				
		// original bd
		var bdOrig:BitmapData 	= new BitmapData(60, 40, true, 0x0);
		var rect:Rectangle 		= new Rectangle();
		rect.setTo(0, 0, 10, 40); 	bdOrig.fillRect(rect, 0xFFFF0000);
		rect.offset(10, 0);		bdOrig.fillRect(rect, 0xFF00FF00);
		rect.offset(10, 0);		bdOrig.fillRect(rect, 0xFF0000FF);
		rect.offset(10, 0);		bdOrig.fillRect(rect, 0xFFFFFF00);
		rect.offset(10, 0);		bdOrig.fillRect(rect, 0xFFFFFFFF);
		rect.offset(10, 0);		bdOrig.fillRect(rect, 0xFF000000);
		
		// filtered bd
		var bd:BitmapData = bdOrig.clone();
		bd.applyFilter(
			bd,
			bd.rect,
			new Point(0, 0),
			new ColorMatrixFilter(
				[
					2.00,	0.15,	-1.15,	0,	0,
					-0.60,	1.30,	0.35,	0,	0,
					0.58,	-1.65,	2.00,	0,	0,
					0,	0,	0,	1,	0
				]
			)
		);
		
		var bmp:Bitmap = new Bitmap(bdOrig);
		addChild(bmp);
		bmp.x = bmp.y = 10;
		
		bmp = new Bitmap(bd);
		addChild(bmp);
		bmp.x = 80;
		bmp.y = 10;
		
	}
}

I’m newbie here, so could you tell me where is bugtracker located?
Thanks.

It’s located at https://github.com/openfl/lime/issues, thanks! :slight_smile: