Skip to content
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

Replace DrawImage implementation for draw.Transformer. #96

Merged
merged 2 commits into from
Jan 3, 2016
Merged

Replace DrawImage implementation for draw.Transformer. #96

merged 2 commits into from
Jan 3, 2016

Conversation

iopred
Copy link
Contributor

@iopred iopred commented Jan 2, 2016

This change has no API modifications and looks a little bit better.

This change has no API modifications.
@llgcode
Copy link
Owner

llgcode commented Jan 2, 2016

Hi @iopred, I think that original implementation treat rotation, using a transformation matrix. The scaler that you using doesn't take this transformation matrix in parameter. You need to take care of rotation/shear transformation if you want to be compatible with previous version of the function. Surely scaling and translation is 90% of usual case.
These implementation have better performance or results in common cases?
Thx @iopred

@iopred
Copy link
Contributor Author

iopred commented Jan 2, 2016

Of course! Sorry I was really tunnel visioned. I will make the modifications to support draw.Transformer.

I think the performance is similar, it's the result which is better, I'll get an example for you.

@iopred
Copy link
Contributor Author

iopred commented Jan 2, 2016

Ok, I have updated it to use Transformer instead.
Attached is two images, the avatars and the small emote are noticeably smoother.

Before:
Before
After:
After

Open the images, it's very noticeable around the emoji image.

@iopred iopred changed the title Replace DrawImage implementation for draw.Scaler. Replace DrawImage implementation for draw.Transformer. Jan 2, 2016
llgcode added a commit that referenced this pull request Jan 3, 2016
Replace DrawImage implementation for draw.Transformer. thx @iopred
@llgcode llgcode merged commit f444aac into llgcode:master Jan 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants