Discuss Scratch

PGBFLITE6373
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

Support, maybe a Cromebook user wants to download ten projects, but can't fit the space. I also heard this could make it less blurry, which helps this post even more. I can't see a problem with this, or think of a reason not to add this
Emittey
Scratcher
16 posts

Stop Wasting Space - Stop Upscaling Uploaded Images

Flowermanvista wrote:

My suggestion is that all JPEG images imported into the editor should not be reprocessed in this manner, but instead saved in their original format, and the same should be done for PNG images, which are subject to similar processing.
Much support. I really hate it when I export a small image, let's say 14x14. They get upscaled to 28x28. A workaround I use is to size the image on one of the corners until the corner you are sizing from is at the center point of the costume editor. This works best with smaller images because you have more control over sizing.

But still, why process the images? If they're already fine, then why should they get processed to two times their size? And why is the Fill Tool so janky on some images?!
HruMan_Productions
Scratcher
100+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

Not bump
thugatwoary
Scratcher
100+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

Wasting space by upscaling images makes no sense. Why is it even a thing?
mayolettucebacon
Scratcher
47 posts

Stop Wasting Space - Stop Upscaling Uploaded Images

thugatwoary wrote:

Wasting space by upscaling images makes no sense. Why is it even a thing?

It increases the size of the image and more data is put inside the image
thugatwoary
Scratcher
100+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

mayolettucebacon wrote:

thugatwoary wrote:

Wasting space by upscaling images makes no sense. Why is it even a thing?

It increases the size of the image and more data is put inside the image
The way that Scratch upscales images does not actually put more data in. It literally just doubles the size, so that what was once 1 pixel is now 2 pixels.
lapisi
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

hey so I did some testing, I uploaded an image into the editor twice, one using the regular upload method and the other with the HD Image Upload feature added by a certain browser extension that I can't name because rules, the ones uploaded using the HD Image Upload feature (a feature designed to preserve image quality) were actually bigger than the ones uploaded normally, meaning that Scratch isn't upscaling them, it's actually downscaling them, which compresses them and lowers the quality, I don't know what exactly is different but I just thought I'd share my results
lapisi
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

bump, anyone want to respond to the point I made above?
undeterminstic
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

lapisi wrote:

hey so I did some testing, I uploaded an image into the editor twice, one using the regular upload method and the other with the HD Image Upload feature added by a certain browser extension that I can't name because rules, the ones uploaded using the HD Image Upload feature (a feature designed to preserve image quality) were actually bigger than the ones uploaded normally, meaning that Scratch isn't upscaling them, it's actually downscaling them, which compresses them and lowers the quality, I don't know what exactly is different but I just thought I'd share my results
hmm very interesting maybe this changes things as this suggestion is now pointless
gdfsgdfsgdfg
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

It resizes cuz small images and scratch is 480p
ajskateboarder
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

gdfsgdfsgdfg wrote:

It resizes cuz small images and scratch is 480p
It doesn't have to resize the image on the server side though. It can just do it on the client when necessary
CST1229
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

lapisi wrote:

(#87)
hey so I did some testing, I uploaded an image into the editor twice, one using the regular upload method and the other with the HD Image Upload feature added by a certain browser extension that I can't name because rules, the ones uploaded using the HD Image Upload feature (a feature designed to preserve image quality) were actually bigger than the ones uploaded normally, meaning that Scratch isn't upscaling them, it's actually downscaling them, which compresses them and lowers the quality, I don't know what exactly is different but I just thought I'd share my results
The addon's HD Upload option encodes the image as a data URL (required for embedding bitmaps into vectors, vanilla also does this when converting bitmap into vector), which increases the size considerably.
Flowermanvista
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

lapisi wrote:

hey so I did some testing…(snip)…meaning that Scratch isn't upscaling them, it's actually downscaling them, which compresses them and lowers the quality, I don't know what exactly is different but I just thought I'd share my results
It depends on the size of the image and whether you use the HD Image extension or not. Important thresholds include 480x360 (the display resolution of the Scratch canvas, its supposed maximum resolution, and what used to be its maximum resolution in Scratch 1.x) and 960x720 (2x the max resolution, the actual largest size of a straight bitmap image in Scratch). The extension also changes things - that works by embedding the image in a SVG file (as if you had clicked “Convert to Vector”), allowing you to bypass the 960x720 limit. Since SVGs are text-based, not binary, the image must be encoded from binary to Base64, which causes a flat 33% size increase (along with a little extra overhead).

All of these tests were conducted with current Scratch in a fresh project by pressing the Create button. For the extension, I used TurboWarp, which I'm 99% sure uses the exact same code. (The extension has a few different settings, so I chose “Original size”).
My tests:
  • Test 1: PNG Cartoon Small
    Before importing into Scratch: 61,673 bytes, 341x360
    Claimed resolution in Scratch editor: 341x360
    After importing and exporting from Scratch: 107,840 bytes, 682x720
    After importing and exporting using extension: 82,847 bytes, 341x360
  • Test 2: PNG Cartoon Big
    Before importing into Scratch: 123,390 bytes, 568x600
    Claimed resolution in Scratch editor: 284x300
    After importing and exporting from Scratch: 123,390 bytes, 568x600
    After importing and exporting using extension: 165,133 bytes, 568x600
  • Test 3: JPG Photograph Small
    Before importing into Scratch: 48,429 bytes, 400x300
    Claimed resolution in Scratch editor: 400x300
    After importing and exporting from Scratch: 261,262 bytes, 800x600
    After importing and exporting using extension: 65,186 bytes, 400x300
  • Test 4: JPG Photograph Big
    Before importing into Scratch: 156,260 bytes, 800x600
    Claimed resolution in Scratch editor: 400x300
    After importing and exporting from Scratch: 156,260 bytes, 800x600
    After importing and exporting using extension: 208,962 bytes, 800x600
  • Test 5: JPG Photograph Giant
    Before importing into Scratch: 1,510,503 bytes, 2272x1704
    Claimed resolution in Scratch editor: 480x360
    After importing and exporting from Scratch: 1,327,791 bytes, 960x720
    After importing and exporting using extension: 2,014,625 bytes, 2272x1704
Some notes:
  • Both of the small images were upscaled by Scratch. The images larger than that, but smaller than 960x720, were untouched.
  • The big JPG image, when exported, had a PNG extension, but still contained the same JPG data, which I consider to be a bug. The small and giant JPG images were both converted to PNGs after being scaled, and both had the correct PNG extension when exported.
  • However, if you download the project file and look inside, all three JPG images had the JPG extension, which is incorrect - as the small and giant ones had been converted to PNG when Scratch scaled them.
  • The giant JPG image lost tremendous amounts of resolution, but was hardly any smaller because of its conversion to PNG.

Last edited by Flowermanvista (Nov. 22, 2023 17:12:35)

lapisi
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

undeterminstic wrote:

(#89)

lapisi wrote:

hey so I did some testing, I uploaded an image into the editor twice, one using the regular upload method and the other with the HD Image Upload feature added by a certain browser extension that I can't name because rules, the ones uploaded using the HD Image Upload feature (a feature designed to preserve image quality) were actually bigger than the ones uploaded normally, meaning that Scratch isn't upscaling them, it's actually downscaling them, which compresses them and lowers the quality, I don't know what exactly is different but I just thought I'd share my results
hmm very interesting maybe this changes things as this suggestion is now pointless
nevermind I just uploaded images and it upscaled them, I know this because they're related to an image I had in the project, I was trying to make an edit using external software but it only works if it's the same size, so I had to resize it manually, it seems it upscales if it's small and downscales if it's big, how about not rescaling images at all?

Last edited by lapisi (Dec. 10, 2023 23:42:05)

lapisi
Scratcher
1000+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

bump, it's really messing with any pixel art I upload
RobotChickens
Scratcher
500+ posts

Stop Wasting Space - Stop Upscaling Uploaded Images

200% Support. This behavior is insane. If I see in the editor that a costume is 15x15 pixels and download it only to see that the dimensions have changed, there's something wrong. This must be so confusing for new scratchers who have their artwork randomly doubled in size if they want to use it somewhere else!
(or they don't care)

Powered by DjangoBB