Copy link to clipboard
Copied
Hello,
Export Movie has an export bug where all png exports are off by -1px or +1px in either the width or the height, sometimes both. but never the dimensions it's set to with a bounding box in Animate. I export everything with pre-set bounding boxes (ex: 600px x 800px) on a much larger canvas (ex: 3000x3000) with a 0.1px stroke at 10% opacity for each bounding box to preserve the aspect ratio for sprite development. I then remove the transparent pixels in photoshop with a batch trim. After doing this they are always off by 1px in W or H. So the size I choose in Animate CC does not match the export it spits out after removing the transparency. It is not a photoshop bug, it is an animate one.
My guess is that it has something to do with the animate's conversion from pixel decimals and how it rasterizes the vectors of strokes. I was wondering if anyone knows a work around for working with large transparent sprite sheets like this in Animate CC. I feel like i've tried everything;
- Using a bounding box with a 0.1 stroke width
- Changing the position of assets to be placed on whole pixel decimals (1.0, 2.0, not 1.1,2.4, etc.)
- Changing the size of assets to be only in whole pixel decimal dimensions.
- Changing the W and H of the document settings
- Placing the renders in the middle of the document vs up against the sides
- Adjusting my bounding boxes with -1 or +1 border (still spits them out wrong)
The +1/-1 bug is very random and was wondering if anyone else has come across this when exporting sprite sheets.
Thanks for your time
Copy link to clipboard
Copied
Hi K7S, could you provide a sample FLA with some of these bitmaps in it? You can use Google Drive or WeTransfer for that. I'm having a hard time understanding this workflow of exporting images from Photoshop, resizing them in Animate and going back to Photoshop to trim them. You could probably skip Animate and do everything in Photoshop if that's the case. Regardless, I've been trying to reproduce the export movie issue but the output seems accurate on my end, no added pixels. How are you trimming these in Ps by the way? There may be more than one method so I want to make sure.
Copy link to clipboard
Copied
I will send you a PM!
Copy link to clipboard
Copied
Hi, sorry for the late response I didn't notice you send me a message to my gmail.
This is a very easy fix as it turns out (I will explain the reasons why you're getting an extra pixel later on).
For now, follow these steps:
Instead of using Photoshop to trim the PNGs, go to Animate and set your stage size to the target resolution (ex.710 x 500 px), align your symbols to the stage and export your sequence. This method will give you pixel perfect dimensions every time.
(Video demonstration below)
Copy link to clipboard
Copied
Now, why are you getting extra pixels with Photoshop?
I believe the issue is with using a stroke as a bounding box. The width and height of the bounding box is meassured using the center line of the stroke, when you increase the stroke size, it expands from the center line but the center line itself remains the same. Notice that even when I increase the stroke size to 80, the dimensions of the box (and the symbol itself) stay the same:
This however will be added up when you export the PNG sequence, even if it's just a 0.1 px stroke, the program rounds up the value and a whole pixel might be added on any dimension which is what you're seeing in Photoshop. This is on top of the antialising which might play a factor as well.
You can see this too in Animate if you convert the strokes to fill (Modify > Shape > Convert Lines to Fills). The W and H values will change:
A good way to work around this is to use fills instead of strokes for the bounding boxes.
Add an extra layer on each symbol, make a fill only rectangle and set the alpha / opacity to 0%.
Then lastly export your png sequence from the library, the contextual menu or the export movie dialog. No need for Photoshop.