extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Adding a PNG with asset manager causes it to be half size

Open snowboyz0825 opened this issue 1 year ago • 9 comments
trafficstars

One would assume that when you import a costume with the asset manager extension, it should have the same result as the import option, but it does not. It should have the same result, but it's only half as big as the original image in the editor. All the pixels are still there, it's just scaled down by half.

If anyone know a workaround in the meantime, please, let me know, as having images import as the proper size is essential to my current project.

snowboyz0825 avatar Apr 21 '24 19:04 snowboyz0825

Scratch's costumes measure 1 stage step for every 2 pixels in an image, and Scratch measures costumes in stage steps. Is this what's happening here?

DNin01 avatar Apr 21 '24 20:04 DNin01

Scratch's costumes measure 1 stage step for every 2 pixels in an image, and Scratch measures costumes in stage steps. Is this what's happening here?

In my halfed-ass experimenting trying to come up with a band aid fix by editing the SVG data, yes, exactly

snowboyz0825 avatar Apr 21 '24 20:04 snowboyz0825

I was doing some testing, and costumes imported via Asset Manager appear to be half as big as uploading the same costume manually through the "Add a Costume" menu.

You can counter this by just doubling the size of your sprite.

Also interesting, in Scratch (and TurboWarp), when you export a bitmap costume and then re-import it, Scratch doubles the size upon import as long as it can fit within 480x360 stage steps. Asset Manager does not do this, hence why every costume it adds is half the expected size.

https://github.com/TurboWarp/extensions/assets/106490990/e31cf9f2-4e14-47a8-ae97-d936bce95728

DNin01 avatar Apr 21 '24 23:04 DNin01

For my specific issue the whole point is importing costumes live while packaged, but they have to be at their original resolution. I also can't just double the size, and I feel asset manager should do this for consistency state, or possibly add a way to double the size of a costume internally instead of using size

snowboyz0825 avatar Apr 22 '24 05:04 snowboyz0825

screen-capture.webm Example of what it does if anyone else is confused

snowboyz0825 avatar Apr 22 '24 05:04 snowboyz0825

Scratch internally has a bitmapResolution parameter for costumes, where, for example, a value of 1 is essentially a 480x360 canvas, and 2 is 960x720 (the usual one). Maybe that could be added as a parameter for the add costume block.

CST1229 avatar Apr 22 '24 12:04 CST1229

That's personally why I requested an HD upload block.

On Mon, Apr 22, 2024, 7:34 AM CST1229 @.***> wrote:

Scratch internally has a bitmapResolution parameter for costumes, where, for example, a value of 1 is essentially a 480x360 canvas, and 2 is 960x720 (the usual one). Maybe that could be added as a parameter for the add costume block.

— Reply to this email directly, view it on GitHub https://github.com/TurboWarp/extensions/issues/1419#issuecomment-2069282367, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYWUKNGBU2E4Y7F3TQCKOTY6T7UZAVCNFSM6AAAAABGRT2WZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRZGI4DEMZWG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Drago-Cuven avatar Apr 22 '24 12:04 Drago-Cuven

Fine then, I'll do it myself

block_4_22_2024-11_17_21 AM

https://github.com/snowboyz0825/snowscodestuff/blob/main/Scratch%20Code/Sprite2.sprite3 Link to download if anyone is interested. Credit is nice but not necessary.

snowboyz0825 avatar Apr 22 '24 18:04 snowboyz0825

Screenshot 2024-04-22 111944 Preview's messed up but it's fine

snowboyz0825 avatar Apr 22 '24 18:04 snowboyz0825