Jump to content

Images saved out of Photoshop simply won't load in Phaser..


Recommended Posts



I have a very strange problem with Phaser.


When I save a new image from Photoshop CC 2015, then use this code in phaser to load an image:


this.load.image('logo', 'images/rielaiz-logo.png');


I then use this code to load the image as a sprite:


this.rielaizLogo = this.add.sprite(158, 157, 'logo');
this.rielaizLogo.anchor.setTo(0.5, 0.5);
All existing images work just fine.
Please help.



Link to comment
Share on other sites

I had this exact problem when I was using Dropbox to store my files.  I found that if you replace a file it won't work.. However if you save it as a new file, delete the old one and rename the new one to your desired name, it will work?

Link to comment
Share on other sites

I agree - it's either the wrong format (i.e. you're trying to load a PSD or something) or too large for your GPU to handle. Maybe thousands of pixels in size.


With Photoshop, it could also ALWAYS be some color profile/color mode problem, like weird off-spec CMYK PNGs :)

Link to comment
Share on other sites

  • 1 month later...

I think I'm getting this issue too whatever it is...

To illustrate how weird this problem is:

If I grab all the files for the "Making your first Phaser Game" tutorial, and, say, load up part9.html from that?
Everything works fine!

If I then go into the assets folder, open sky.png into Photoshop and make any kind of change to the image (like, say, grab one of the colors already in the image and paint it somewhere else in the picture) and then Save (not even Save-As-- just Save.) and-- having done nothing else -- then try to open part9.html again?
Nothing loads.

I can get the game to run again if I comment out the line:
game.load.image('sky', 'assets/sky.png');

So... it's just loading that updated image that's the problem.

If I replace the file with an 'original' version, and repeat the same process with, say, MSPaint though, the updated image works fine.
So it's definitely something Photoshop is doing to the image that makes it no longer work in a Phaser game... but I have no idea what that might be.


Link to comment
Share on other sites


  • Recently Browsing   0 members

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