This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-10 14:33:32

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

how to paste semi-transparent images using nothing but Scratch

Sorry ahead of time if this is beating a dead horse  big_smile

For this little graphic tutorial done in v1.4 I will be adding a transparent Earth into the background of my space game set on the Moon's surface, see the game screen below. I initially was going to just add the Earth image as a ghosted sprite. But the more I worked on the game, the more I needed to delete that sprite to get my game back to speed when running (due to all the other sprites and animations I had going on at the same time.)

the background with some game sprites...
http://img576.imageshack.us/img576/3461/41639592.jpg



the unaltered Earth image I found (licensed for reuse and alteration according to Advanced Google image search) from http://farm2.static.flickr.com/1431/698695850_124e8d8271.jpg

http://img268.imageshack.us/img268/9661/imageearth.jpg




Once I had the Earth From Space image I wanted to use cut out (I used my fave free app, Irfanview) I imported it into Scratch using the "Choose new sprite from file."

http://img706.imageshack.us/img706/6987/57994942.jpg




This let me drag it to where I wanted it as well as re-size it (Size block), adjust the transparency (ghost effect) till it looked just like I wanted it to. I also painted out a few stars with black that the Earth now covered on the background so they didn't seem to be shining through the planet.

http://img687.imageshack.us/img687/3822/69327884.jpg




You would think that the next step would be to right click the screen and select "save picture of stage" to export our nice, finished image but don't! This feature will "optimize" (a generous term) the exported image as well as alter the final amount of transparency or ghost effect on the Earth. If you look closely at my image, you will notice that space is not solid black but instead has a misty, blue haze that fades across it. Using "save picture of stage" will destroy all that!

The solution is to take a few extra steps by right-clicking the stage and selecting "grab screen region for new sprite" instead and dragging a square just around the edges of the Earth part of the image. This will create an entirely new sprite from your selection.

Now open that new sprite's Costume tab. Right-click the costume and select "export this costume." The image that you save will be an exact copy instead of the "optimized" result discussed earlier.

Lastly, open your background (mine is the costume for my Stage) costume in Scratch's Paint Editor. Click on the Import button and select your saved image of the transparent Earth. It will join your image as a selection which you can drag to the correct position.

http://img709.imageshack.us/img709/443/22533209.jpg




Now just hit save, go back and delete the 2 extra sprites we made and now you have your transparently pasted image using nothing but Scratch.

ps. As usual, I tried to be thorough, especially since this is a tutorial. In practice this whole process can be done very quickly. If you spot any mistakes or have any improvements, please post!


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#2 2010-07-10 14:42:41

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: how to paste semi-transparent images using nothing but Scratch

Wow - that's neat! I never knew you could do that  smile

Offline

 

#3 2010-07-10 14:48:39

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: how to paste semi-transparent images using nothing but Scratch

Thanks and me neither, just stumbled across while working on a game. I thought it was cool so I had to post it!


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#4 2010-07-10 16:38:39

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: how to paste semi-transparent images using nothing but Scratch

Great tip!


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2010-07-10 19:58:45

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: how to paste semi-transparent images using nothing but Scratch

That's awesome!  smile

Of course, you could use Control+PrintScreen to take a picture of the screen, get it in Paint, and save the Earth from there - but as you mentioned, your method doesn't require any external programs.  smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#6 2010-07-11 14:34:11

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: how to paste semi-transparent images using nothing but Scratch

Thanks a lot and thanks for adding your tip Jonathanpb!


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer