sprites

Looking to build a team or have a job to offer?

Post » Mon Sep 30, 2013 6:13 am

Hallo my fellow scirra fans
I have a question?

When i insert my sprites i always have a white background how do i get rid of this?
B
10
S
3
G
1
Posts: 5
Reputation: 896

Post » Mon Sep 30, 2013 7:37 am

This is probably related to the file type of your image. .jpeg images, for instance, don't save out with the alpha channel intact. You need this to preserve a clear background image. If you want to have an image with a clear background, you have to change the file type to a format such as .png, which will preserve the alpha channel (transparency). So remove the white background in your image editor of choice (ex. photoshop), then save the image as a .png (this will allow you to import the image with no white background). I hope this helps, if you run into any other problems, let me know.
B
5
Posts: 11
Reputation: 623

Post » Mon Sep 30, 2013 11:04 am

Sry jk can you please tell me from step 1 how to prevent the background from not appearing in my construct when i add an image.

I have tried what u suggested but i am still struggling with the issuestef17562013-09-30 11:09:40
B
10
S
3
G
1
Posts: 5
Reputation: 896

Post » Mon Sep 30, 2013 12:29 pm

-In an image editor remove the (white) background and save the image as .png

It should be as easy as that.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Sep 30, 2013 6:28 pm

(Moderators will likely want to move this to the "How do I" section.)

For the purposes of this explanation I will use the free software Gimp as my image editor (since it's, well, free). If you don't already have Gimp, you can pick it up at http://www.gimp.org/

1. Open the image in Gimp. In the layers panel on the right, right click on your image layer and select the "add alpha channel" option near the bottom of the list.



2. Either by using the "Eraser" tool by hand, or by using the "Select by Color" Tool, remove the white background of the image, which should reveal a dark grey "checkerboard" pattern behind your image (the graphical representation of transparent pixels). (I would recommend using a brush with a hardness of 100 if you are using the Eraser tool. Change the hardness of the brush in the Tool Options panel on the left)



3. Once the background is removed, select the "Export" option under "File", change the filetype to a .png, then save it to your desired location. Now when you open the Sprite in Construct 2 and place it in your work area, you will notice the white background is gone. If there are still small areas of white, this is due to not doing a perfect job during the clean up process in Gimp, simply re-open it in gimp, be more precise with the removal of the background, then repeat the process of exporting as a .png file.





-Notes-

Make sure you save your files to places where you know how to find them again.

Make sure that if you use the Select by Color Tool and there happens to be parts of your image that are the same color as the background you are trying to remove, that you don't accidentally remove those parts too. It might be necessary to use the Eraser tool only at that point, or lower the tolerance/threshold of the Select by Color Tool.

It might be necessary to resize the image in Gimp before exporting now that the background is gone to maximize the performance of the image in your game. If the white background added another 40 pixels on all sides of the image, even if you remove the white the size of the image will remain the same, even with transparent pixels. So crop the image closer to your actual content then export it. This will reduce file size and help performance. Also be sure to use "power of 2" sizes when at all possible. (64x64, 128x128)jktozier2013-09-30 19:43:08
B
5
Posts: 11
Reputation: 623

Post » Tue Oct 01, 2013 1:31 am

this is in the wrong erea this should be in how do I
B
41
S
11
G
7
Posts: 514
Reputation: 9,701

Post » Tue Oct 01, 2013 1:42 am

Yeah I pointed that out before my explanation. Stef1756 must not have noticed the other section available.
B
5
Posts: 11
Reputation: 623


Return to Job Offers and Team Requests

Who is online

Users browsing this forum: No registered users and 2 guests