-
-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilterQuality.high drawing output is pixelted on both canvas and overlay #2551
Comments
Is this on all platforms? Have you tried with a Flutter versions before 3.10.0? |
I think I am using |
What does |
Flutter 3.10.0 • channel stable • https://github.com/flutter/flutter.git As I said, if the image size is 100x100 output is perfect on both overlay and canvas. Anything above 200x200 gets distorted. |
@spydon anything I can look at here? 100x00 is ok for now but the issue is on tablets this might not look nice. |
Did you try with a flutter version before 3.10? So that we can rule out a regression from flutter? |
There is no difference in output fluter 3.0.0. 512x512 pixelates while 100x100 works. Flutter 3.0.0 • channel stable • https://github.com/flutter/flutter.git |
And what size did you say that the image was? |
100px x100px works. anything bigger ends up with this issue. e,g, was 512x512 |
I mean the source image, what size is that? |
Ah that is the size for the source image, that's strange. Can you upload the images here? |
And what size are you rendering it at? I would guess that you're scaling down the larger image in the |
When I debug the size of the sprite is 46. Basically, think of it as fill screen width/8. My Code can be found at the top. Can you give me hints as to how to implement what you are saying? |
There is an extension on class ChessPiece extends SpriteComponent {
final double sideLength;
ChessPiece(this.sideLength) : super(size: Vector2.all(sideLength);
@override
Future<void> onLoad() async {
final sourceImage = Flame.images.load('path');
final image = sourceImage.resize(size);
sprite = Sprite(image);
}
} if that doesn't work I would try to use a |
That is the old way of doing it, now you should use the |
Seems like this is a regression in Flutter then (or it's just particularly bad on your image), you could try the same thing in a |
@patolax did you ever try this in a custom painter? To see whether the issue is with Flutter or not. |
FilterQulity.Medium is what's best apparently. This is a flutter issue. FilterQulity.Medium fixed it for me. |
Oooh, thanks for the info! It even says so in the dartdocs. |
According to the Flutter docs, tests and #2551 FilterQuality.high is actually producing worse output than FilterQuality.medium in almost all cases (the exception is when you use a very high scale factor). This PRs set the places we have defined as high to medium instead.
My code is below and the drawing output. The sprite size used is 512x512.
The game has no scaling and this is a simple 2D game.
As shown by the code we use size to scale the sprite size as required by the game and
paint.filterQuality = FilterQuality.high;
to improve output quality.The image shows, what's drawn on canvas and an overlay dialog box.
As you can see lines and edges are super pixelated on both canvas and overlay. How can I improve this output?
(any vertical or horizontal line looks ok)
The text was updated successfully, but these errors were encountered: