[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Photoshop For Image Mapping

Here's a question for you. I'm trying to use image files as a way to
store information on what terrain type is at each of 1000x1000 points in
a game zone. Since I'm using a limited set of terrain types, I figure I
can just use a 1000x1000 BMP or PNG file where each pixel represents
what tile to draw, or what terrain (or transition between terrains) to
use at each point. In fact I've done this using stark blue and green for
water and grass, ripping the overworld map from "Final Fantasy I":

But since I want to figure out where to put transition tiles like
coastlines, and prefer not to calculate their position on the fly, it's
important to have exact control over the pixels. But Photoshop is being
too smart for me! When I select an area of an image and try to fill it
in with one color, I get fancy shading regardless of what I do with
layers. When I want (0,255,0,255), I don't want variable translucent
green at the edges of a landmass! I could use MS Paint, but that's not
exactly a full-featured graphics program; specifically it's limited in
selection areas and layering.

Any ideas?

As an alternative, is there a better way to rapidly read one million
data points from an image (or a raw data file) and convert them to a
honkin' big list of terrains or tiles? I don't mind it being a
one-dimensional list since I can say "value at (x,y) =
biglist[y*1000+x]", but I'd like to have two general options for making
parts of the game world: loading from images where they exist, and
procedurally generating new ones where they don't. As a side note, a
zone will need a file to store data on objects, so sticking image data
into a raw data file rather than storing as an image would be OK.