Jump to content

Browser image scaling


Recommended Posts

I don't think this is specific to Phaser so I'll post it here.

In this example an image is loaded and displayed.  And here's that image direct, which displays as the same size it's displayed in the example, which is why this doesn't seem specific to Phaser.  Now if I download that image and open it with an image viewer, the image is displayed smaller than the browser is displaying it!  This means the image is being scaled up somehow in the browser, and results in images looking a little blurry due to what I assume is anti aliasing.

Why is this happening, and how do you get around it?  In my Phaser based game I've determined that the images look far better if I export them 2x the size I need them, and use phaser to scale them to 0.5.  This however means I need to add an extra scaling call to every sprite I instantiate.

Link to comment
Share on other sites

I havent looked at the example but have you checked the dpi of the image? I dont think this is the issue you're seeing but it can cause different software to display images at different pixel sizes.

edit: actually I did download the image as I became curious, the image is something like 600x500, when I open it up in preview its the exact same size as the browser displays it. Suggests that this possibly some issue with whatever software you are using to open the image, not with the image itself, nor with the browser.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...