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

blurry faces #48

Closed
Reispfannenfresser opened this issue Jul 9, 2020 · 0 comments · Fixed by #49
Closed

blurry faces #48

Reispfannenfresser opened this issue Jul 9, 2020 · 0 comments · Fixed by #49
Labels
bug Something isn't working

Comments

@Reispfannenfresser
Copy link
Collaborator

Environment info

  • BlockMap version: 2.1.0
  • Java version: java-14-openjdk
  • Operating system: Linux triceraptodactyl 5.6.16-1-MANJARO #1 SMP PREEMPT Wed Jun 3 14:26:28 UTC 2020 x86_64 GNU/Linux

Description

The players skins are loaded, but the displayed faces are blurry.

Steps to reproduce

  1. Load any world
  2. Find a player pin
  3. Make sure it's not a merged pin
  4. Look at the face

Actual result

The face is blurry.

Expected result:

The face should be sharp.

Screenshots

How my skin's face is displayed:
Screenshot from 2020-07-10 01-19-56

How my skin's face looks:
Screenshot from 2020-07-10 01-20-55

@Reispfannenfresser Reispfannenfresser added the bug Something isn't working label Jul 10, 2020
saibotk added a commit that referenced this issue Jul 14, 2020
This commit fixes the weird blurry textures for player heads, as seen in #48

To fix the blurry images, we first need to set the requested width / height in the image constructor and also set the smoot parameter to false, which can only be set, when using the constructor. 
As we just want a small part of the image (only the head), we need to scale the whole image by 16x, so that we can later extract the head with a resolution of 128 pixels, that will be scaled correctly (pixel-perfect, without smoothing).
The scaling without smoothing, seems to only work this way, as the "smooth" parameter cannot be set/changed when using another constructor/later.
Another option would be sampling the image with the PixelReader and  creating a new Image with the PixelWriter by hand. 

More information can be found here: https://stackoverflow.com/a/16092631
@saibotk saibotk linked a pull request Jul 14, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant