Discuss Scratch

PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

While technically a Question About Scratch, I figured only ATers would know the answer. :3

I would like to import a bitmap image as a costume. The trouble is that the image has dimensions greater than 480 x 360. Simply uploading results in the image being resized and compressed. After this didn't work, I tried downloading the project, changing the sb2 to a zip, extracting, and physically swapping out an old costume with the large image. The large image, when opened in scratch, was cropped down to 480 x 360.

Is there any way to do this? If so, how?
Penguin9090_new
Scratcher
500+ posts

Importing Large Bitmaps to Scratch?

Splice the image into a 2x2 or 3x3 or 4x4 grid and upload each of them to the editor. Then add a scrolling script.
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

Penguin9090_new wrote:

Splice the image into a 2x2 or 3x3 or 4x4 grid and upload each of them to the editor. Then add a scrolling script.
The entire point of this was to avoid a scrolling script. :3

It's a large terrain that I'd like to have as all one costume to prevent lag.
Penguin9090_new
Scratcher
500+ posts

Importing Large Bitmaps to Scratch?

PullJosh wrote:

Penguin9090_new wrote:

Splice the image into a 2x2 or 3x3 or 4x4 grid and upload each of them to the editor. Then add a scrolling script.
The entire point of this was to avoid a scrolling script. :3

It's a large terrain that I'd like to have as all one costume to prevent lag.
Well, then I don't know
comp09
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

My Death Waltz project uses 960x720 costumes to reduce the number of assets. I used Kurt to import the costumes.

Last edited by comp09 (March 11, 2015 00:00:11)

Superdoggy
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

1. open image in inkscape by importing a bitmap.
2. save as plain svg file
3. import into scratch, resize as necessary.
4. you're done!
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

Superdoggy wrote:

1. open image in inkscape by importing a bitmap.
2. save as plain svg file
3. import into scratch, resize as necessary.
4. you're done!
:O Wow! Didn't know it was so simple! Thanks!
MegaApuTurkUltra
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

PullJosh wrote:

Superdoggy wrote:

1. open image in inkscape by importing a bitmap.
2. save as plain svg file
3. import into scratch, resize as necessary.
4. you're done!
:O Wow! Didn't know it was so simple! Thanks!
That's what I usually do, but it slows stuff down a lot of the time.

When I wrote a program to import hundreds of costumes into a sprite2 file to avoid Scratch crashing and memory-leaking when I upload them manually, I accidentally discovered that bitmaps can actually go off canvas, like svgs, it's just that the costume editor doesn't allow them.
You see, what happened is I forgot to set the center coordinate of 480x360 costumes, and they still showed up fine on stage, but 3/4 were cut off in the costume editor, and when I exited the editor, it auto-cropped the costume.

The big problem with svg is lag, so I recommend using bitmaps. Hack a large bitmap into a sprite2 file, upload it, and profit
Just don't open the costume editor

Also, size hacks may be needed, just like with svgs

Last edited by MegaApuTurkUltra (March 11, 2015 01:34:36)

comp09
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

MegaApuTurkUltra wrote:

PullJosh wrote:

Superdoggy wrote:

1. open image in inkscape by importing a bitmap.
2. save as plain svg file
3. import into scratch, resize as necessary.
4. you're done!
:O Wow! Didn't know it was so simple! Thanks!
That's what I usually do, but it slows stuff down a lot of the time.

When I wrote a program to import hundreds of costumes into a sprite2 file to avoid Scratch crashing and memory-leaking when I upload them manually, I accidentally discovered that bitmaps can actually go off canvas, like svgs, it's just that the costume editor doesn't allow them.
You see, what happened is I forgot to set the center coordinate of 480x360 costumes, and they still showed up fine on stage, but 3/4 were cut off in the costume editor, and when I exited the editor, it auto-cropped the costume.

The big problem with svg is lag, so I recommend using bitmaps. Hack a large bitmap into a sprite2 file, upload it, and profit
Just don't open the costume editor

Also, size hacks may be needed, just like with svgs
I hacked a thousand or so oversizsed costumes into that Death Waltz project using Kurt, which is a Python library that can be used as a batch-hacker.
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

MegaApuTurkUltra wrote:

PullJosh wrote:

Superdoggy wrote:

1. open image in inkscape by importing a bitmap.
2. save as plain svg file
3. import into scratch, resize as necessary.
4. you're done!
:O Wow! Didn't know it was so simple! Thanks!
That's what I usually do, but it slows stuff down a lot of the time.

When I wrote a program to import hundreds of costumes into a sprite2 file to avoid Scratch crashing and memory-leaking when I upload them manually, I accidentally discovered that bitmaps can actually go off canvas, like svgs, it's just that the costume editor doesn't allow them.
You see, what happened is I forgot to set the center coordinate of 480x360 costumes, and they still showed up fine on stage, but 3/4 were cut off in the costume editor, and when I exited the editor, it auto-cropped the costume.

The big problem with svg is lag, so I recommend using bitmaps. Hack a large bitmap into a sprite2 file, upload it, and profit
Just don't open the costume editor

Also, size hacks may be needed, just like with svgs
Ahh… I see. I had opened the costume editor. Thanks for the tip!
Superdoggy
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

MegaApuTurkUltra wrote:

PullJosh wrote:

Superdoggy wrote:

1. open image in inkscape by importing a bitmap.
2. save as plain svg file
3. import into scratch, resize as necessary.
4. you're done!
:O Wow! Didn't know it was so simple! Thanks!
That's what I usually do, but it slows stuff down a lot of the time.

When I wrote a program to import hundreds of costumes into a sprite2 file to avoid Scratch crashing and memory-leaking when I upload them manually, I accidentally discovered that bitmaps can actually go off canvas, like svgs, it's just that the costume editor doesn't allow them.
You see, what happened is I forgot to set the center coordinate of 480x360 costumes, and they still showed up fine on stage, but 3/4 were cut off in the costume editor, and when I exited the editor, it auto-cropped the costume.

The big problem with svg is lag, so I recommend using bitmaps. Hack a large bitmap into a sprite2 file, upload it, and profit
Just don't open the costume editor

Also, size hacks may be needed, just like with svgs
Yeah, lol, bitmaps have always been able to go off the screen. It's just that annoyingly enough, the editor just crops the image… which means that it's hard to keep any large bitmaps at full size - one wrong click = lots of pain uploading it again. xP that's why I use vector bitmaps, despite the slowdown.

Interestingly enough, no hacking required to get a large bitmap into 1.4. In Scratch 1.4 there was a very handy workaround… all that was needed was a sizable monitor, so that the “grab screen region for new sprite” could be used to make a gigantic screensized sprite and draw on that. xD So that's how I drew my offscreen sprites in my older projects. xD
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

Superdoggy wrote:

-Quote snip-
Yeah, lol, bitmaps have always been able to go off the screen. It's just that annoyingly enough, the editor just crops the image… which means that it's hard to keep any large bitmaps at full size - one wrong click = lots of pain uploading it again. xP that's why I use vector bitmaps, despite the slowdown.

Interestingly enough, no hacking required to get a large bitmap into 1.4. In Scratch 1.4 there was a very handy workaround… all that was needed was a sizable monitor, so that the “grab screen region for new sprite” could be used to make a gigantic screensized sprite and draw on that. xD So that's how I drew my offscreen sprites in my older projects. xD
xD That's how I did it too.

Come to think of it… The entire thing is pixel art anyway… Maybe I should just use 1.4.
Superdoggy
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

PullJosh wrote:

Superdoggy wrote:

-Quote snip-
Yeah, lol, bitmaps have always been able to go off the screen. It's just that annoyingly enough, the editor just crops the image… which means that it's hard to keep any large bitmaps at full size - one wrong click = lots of pain uploading it again. xP that's why I use vector bitmaps, despite the slowdown.

Interestingly enough, no hacking required to get a large bitmap into 1.4. In Scratch 1.4 there was a very handy workaround… all that was needed was a sizable monitor, so that the “grab screen region for new sprite” could be used to make a gigantic screensized sprite and draw on that. xD So that's how I drew my offscreen sprites in my older projects. xD
xD That's how I did it too.

Come to think of it… The entire thing is pixel art anyway… Maybe I should just use 1.4.
Well, then you have to import it into the 1.4 paint editor in chunks, which is really annoying if you don't have an extra large monitor. xD
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

Superdoggy wrote:

PullJosh wrote:

Superdoggy wrote:

-Quote snip-
Yeah, lol, bitmaps have always been able to go off the screen. It's just that annoyingly enough, the editor just crops the image… which means that it's hard to keep any large bitmaps at full size - one wrong click = lots of pain uploading it again. xP that's why I use vector bitmaps, despite the slowdown.

Interestingly enough, no hacking required to get a large bitmap into 1.4. In Scratch 1.4 there was a very handy workaround… all that was needed was a sizable monitor, so that the “grab screen region for new sprite” could be used to make a gigantic screensized sprite and draw on that. xD So that's how I drew my offscreen sprites in my older projects. xD
xD That's how I did it too.

Come to think of it… The entire thing is pixel art anyway… Maybe I should just use 1.4.
Well, then you have to import it into the 1.4 paint editor in chunks, which is really annoying if you don't have an extra large monitor. xD
Wait… If I'm in 1.4, can I just upload a costume I have (png) that's bigger than 480 x 360 and have it work?
Superdoggy
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

PullJosh wrote:

Superdoggy wrote:

PullJosh wrote:

Superdoggy wrote:

-Quote snip-
Yeah, lol, bitmaps have always been able to go off the screen. It's just that annoyingly enough, the editor just crops the image… which means that it's hard to keep any large bitmaps at full size - one wrong click = lots of pain uploading it again. xP that's why I use vector bitmaps, despite the slowdown.

Interestingly enough, no hacking required to get a large bitmap into 1.4. In Scratch 1.4 there was a very handy workaround… all that was needed was a sizable monitor, so that the “grab screen region for new sprite” could be used to make a gigantic screensized sprite and draw on that. xD So that's how I drew my offscreen sprites in my older projects. xD
xD That's how I did it too.

Come to think of it… The entire thing is pixel art anyway… Maybe I should just use 1.4.
Well, then you have to import it into the 1.4 paint editor in chunks, which is really annoying if you don't have an extra large monitor. xD
Wait… If I'm in 1.4, can I just upload a costume I have (png) that's bigger than 480 x 360 and have it work?
No, you have to splice it into chunks, capture screen region, and import each one into the paint editor and join them back together. probably better just to use vector bitmaps or hacked 2.0 ones
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

Superdoggy wrote:

PullJosh wrote:

Superdoggy wrote:

PullJosh wrote:

Superdoggy wrote:

-Quote snip-
Yeah, lol, bitmaps have always been able to go off the screen. It's just that annoyingly enough, the editor just crops the image… which means that it's hard to keep any large bitmaps at full size - one wrong click = lots of pain uploading it again. xP that's why I use vector bitmaps, despite the slowdown.

Interestingly enough, no hacking required to get a large bitmap into 1.4. In Scratch 1.4 there was a very handy workaround… all that was needed was a sizable monitor, so that the “grab screen region for new sprite” could be used to make a gigantic screensized sprite and draw on that. xD So that's how I drew my offscreen sprites in my older projects. xD
xD That's how I did it too.

Come to think of it… The entire thing is pixel art anyway… Maybe I should just use 1.4.
Well, then you have to import it into the 1.4 paint editor in chunks, which is really annoying if you don't have an extra large monitor. xD
Wait… If I'm in 1.4, can I just upload a costume I have (png) that's bigger than 480 x 360 and have it work?
No, you have to splice it into chunks, capture screen region, and import each one into the paint editor and join them back together. probably better just to use vector bitmaps or hacked 2.0 ones
I'll stick to vector bitmaps.
mrvankil
Scratcher
100+ posts

Importing Large Bitmaps to Scratch?

You can use griffpatch's megazoom trick. Make a sprite to be the base background and also a second costume that is just one little dot. At game start switch to the dot costume then set sprite size to 1200 percent or whatever and then tell it to switch to the real costume. This will give your map the proper dimensions. On the base map costume switch it to vector then import each real map piece that you want to add and keep it vector and resize it to the size you want and then place it on the base map where you want it. This however does take up lots of memory but allows easy scrolling. I am currently working on a Tron game where I do that and also I have a game in progress where you can see an example of this although it isn't finished. Also if you get carried away it can crash a flash player. Here is the example http://scratch.mit.edu/projects/41695276/
MegaApuTurkUltra
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

mrvankil wrote:

You can use griffpatch's megazoom trick. Make a sprite to be the base background and also a second costume that is just one little dot. At game start switch to the dot costume then set sprite size to 1200 percent or whatever and then tell it to switch to the real costume. This will give your map the proper dimensions. On the base map costume switch it to vector then import each real map piece that you want to add and keep it vector and resize it to the size you want and then place it on the base map where you want it. This however does take up lots of memory but allows easy scrolling. I am currently working on a Tron game where I do that and also I have a game in progress where you can see an example of this although it isn't finished. Also if you get carried away it can crash a flash player. Here is the example http://scratch.mit.edu/projects/41695276/
1) I already mentioned that, please read before posting.
2) That's not what OP is asking for (I just said to make sure to use it).
3) It's not “griffpatch's” trick. This trend on Scratch of giving credit to the wrong people needs to stop.
4) The problem is already resolved. Again, read before posting.
comp09
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

Before you go and import your 30 megapixel images, please read this article about Flash Player limits: https://helpx.adobe.com/flash-player/kb/size-limits-swf-bitmap-files.html
PullJosh
Scratcher
1000+ posts

Importing Large Bitmaps to Scratch?

comp09 wrote:

Before you go and import your 30 megapixel images, please read this article about Flash Player limits: https://helpx.adobe.com/flash-player/kb/size-limits-swf-bitmap-files.html
Thanks for the link! I should be all set.

Powered by DjangoBB