• Bugs
  • Layer to png

Related Discussions
...

Hi Guys!
I tell you a little about the situation before going to the problem itself.
We have in Unity a png of a building, and each a certain amount of time, on top of that png, we put a clip made in Spine, which uses the same png that is underneath.
To perfectly match everything and see no gap between the Spine clip and the PNG, we use the "LayertoPNG" script to export all Photoshop material to Spine and also use the .JSON that generates this export, so that everything matches As it is in Photoshop.

The problem using this pipeline is that it doesnt exactly respect the same position.

Summarizing the problem: Script Layertopng doesnt exactly respect the position of layers that it exports from Photoshop to Spine (it has a slight offset)

Thanks!

Hello Adrian, can you post an image example of what you spot as the problem? It never occurred to me and I'd like to see what is wrong precisely (:

Hi, we have pipeline that match exactly. Contact me if you want.

Thanks for the reply!
Here I upload a gif that I made to see the difference between the images

I comment on the process I did:
-export all images with the layer to png script (except "Png_Template" that saves it as png from Photoshop, without using the script)

-Then use the tool from Spine, "Import Data" to bring all the pngs I export from Photoshop

-Then I inserted the image "Png_Template" in the position 0,0

I tried to redo all your steps, and I noticed that your 0,0 position is arbitrary and not set by Spine, since usually if you set the translation coordinates to 0, 0 the image would be placed in the exact middle of the origin and not offset to one corner of it. In my case everything matches by placing the image manually so that one corner fits the origin. My guess is you simply placed the reference image slightly offset.

Try exporting a png from your spine composition and see if some parts offset compared to the original image. They shouldn't.

If you think there's still an error please send the photoshop file and the spine working files to contact@esotericsoftware.com referring to this thread in the mail.

Sorry for not clarifying, when I refer to the 0,0 position of the image, it is to the position that results from dividing the width and height in half, which is the same position that is in the Photoshop file

What is the size of your original image?
What are your export settings for the LayersToPng script?

And about your original problem, how about just having directly the spine image on an animation that is not moving instead?

The "Png_Template" image has a size 1024 x 716 and if I want to locate exactly in the same place as in Photoshop, I have to divide it by 2
This is the comparison between the image exported with the Script and the one saved as png from Photoshop

Are the numbers a reference to where the image needs to be placed to match the other exported images?
What is the dimension of the LayertoPNG image? do you notice an offset?
Also please answer this:

What are your export settings for the LayersToPng script?

These are the settings:


  • The size of Psd file is 1024 x 716
  • The size of png exported without the Script is 1024 x 716
  • The size of the png exported with the script is 1026 x 718

Having the padding set to 1 will add 1px on each side of your images, which explains why your second image is 2 px larger.

Just set the padding to 0 to have the image positioned right.
But please note a padding is added in order to avoid artifacts on the borders.