Using Photoshop to do 2d Images

Community Forums/General Help/Using Photoshop to do 2d Images

GrayKnight2k(Posted 2010) [#1]
I want to use Photoshop to create my two-dimensional graphics for my game in Blitz3d. I am also using sprite candy / particle candy.

I am running into a difficult problem I am not sure how to resolve.

Every time I create an image in Photoshop, save it as .png or .bmp, and run it in Blitz3d, it has a white blocky edge surrounding it in my game. Photoshop itself shows the image I've created with perfect edges, but the moment I save it to .png or .bmp for use with Blitz3d, the image displays in the game program with white blocky edges.

How do I create or convert the images in Photoshop to accurately display in Blitz3d without these terrible outlines? The only MANUAL way of resolving this problem is to save a Photoshop file to .png or .bmp, then to go into PAINT and remove the imperfections, pixel by pixel. This is an insane, and ridiculous method. Not to mention, it always ends up looking HORRIBLE since I get a chunky 8-bit style outline to my rather nice looking image.

Please help!


GIB3D(Posted 2010) [#2]
Try adding 16+32 in the "flags" parameter for whatever function you're using to load the images with.

16: Clamp U
32: Clamp V


xlsior(Posted 2010) [#3]
I don't know if B3D is running into the same issue as Blitzmax, but you may try searching the forum for a tool called 'defringe'.

After running PNG's through it, it will clean them up and no longer show the border in BlitzMax.

worth a shot...


GrayKnight2k(Posted 2010) [#4]
Thanks for your help, guys. I will give these solutions a shot as soon as I get a chance.


GfK(Posted 2010) [#5]
If you're trying to use Blitz3D's LoadImage with these images, then the problem is that Blitz3D's 2D commandset (which LoadImage belongs to) does not support alpha.

Anything you draw in Photoshop with the brush tool, will have a soft edge so you need to get rid of that before you save the image. The soft edge will manifest itself as a white outline.

Whether you remove the 'soft' pixels manually, or use a tool to do it, there's no two ways about it - its going to look fairly horrible however you do it.

My recommendation which probably isn't what you want to hear: Get Blitzmax.


Kryzon(Posted 2010) [#6]
There's another recommendation, in case using Blitz3D is a 'must' and you also 'must' have images with alpha channels: use a pixel-perfect sprite lib, like SpriteControl (make sure to study it's command set and usage).

EDIT: That's just a way to use alpha channels with images. I don't know if that relates to this edge problem you have. Are you sure the edges are 'burnt' into the images? if you use another program like MSPaint or the windows default viewer, do they still have edges or is that blitz-specific?


Yasha(Posted 2010) [#7]
As far as I'm aware, .bmp doesn't support alpha. I would have expected .png to do so without tweaking anything... try fiddling with the export settings?

Particle Candy (don't have Sprite Candy, but I expect it's the same) loads textures with alpha enabled by default, so it does sound like you're not exporting the alpha channel properly.


_PJ_(Posted 2010) [#8]
As far as I'm aware, .bmp doesn't support alpha. I would have expected .png to do so without tweaking anything.


I think this is it. Also, be aware of your source image quality.if the colour of a pixel is even one bit off, then it will be recognised by Blitz as different from the Mask colour or whatever, and show up.

A lot of the the time, Alpha or Mask colours are set as Magenta (Presumably Magenta's a very rare colour naturally?) Maybe you could try changing the colours to this.


D4NM4N(Posted 2010) [#9]
I like PS for complex autofx layers and photo stuff but for 2d painting, sprites and pixelwork i prefer gimp simply because i prefer the tools it offers for this sort of thing.
Worth trying if you have not already.

In PS, if you want to eliminate the black or white anti aliased edges, use the layers and turn off the background layer before export. If as GFK pointed out you are using b3d images then you cannot do this (only masks are supported afaik), so are limited to the hard pencil tool which does not blend.

In B3d you can however make a 3d-2d system that uses 'flat' geometry with alpha blended textures.