Page 13 of 14

Re: MapMatic +2

Posted: Fri Jun 16, 2017 11:21 pm
by Solomoriah
The filter would do whatever I decide it would do; I'd be writing it myself.

But the obvious thing is to do this:

1) Load each tile into Gimp
2) Add a white layer below the current image
3) Flatten the image, then add an alpha channel
4) Convert white to transparency

Here's the tricky part: Sometimes, gray areas should be partially transparent. Sometimes they should not. Certain tiles were meant to cover the border lines, for example. The white fill inside doors has to stay "solid" as does the gray fill inside things like the diagonal walls.

I'm honestly not certain how to do what you are asking, actually. The closer I look, the more complicated it seems.

Re: MapMatic +2

Posted: Sat Jun 17, 2017 11:16 am
by Clever_Munkey
Solomoriah wrote: Here's the tricky part: Sometimes, gray areas should be partially transparent. Sometimes they should not. Certain tiles were meant to cover the border lines, for example. The white fill inside doors has to stay "solid" as does the gray fill inside things like the diagonal walls.

I'm honestly not certain how to do what you are asking, actually. The closer I look, the more complicated it seems.
Another option might be, instead of worrying about each tile responding the same, to do vector addition with a floor at 0 and ceiling at 255. So (0,0,0,???) would become whatever color was input (or stay 0 if it was negative). (255,255,255,???) would remain 255 if the vector was positive and would become something else if it was negative. It would definitely be a bit trickier to use, but might be easier to program.

The fade tiles already alter color technically, or at least appear to. Could we get away with creating green, red, and blue fade tiles, and then just use a combination of those 4 (red, green, blue, and white) to create whatever color was desired? It would be very awkward for sure, but might work.

There is also the fall back option of having separate images for each color. The name of the PNG could just be [hexcode][normal tile name]. This might take a while, but I would be willing to put in the work.

Re: MapMatic +2

Posted: Sat Jun 17, 2017 11:38 am
by Solomoriah
The fade tiles are partially transparent black, (0, 0, 0, 0.5) or something like that; the fill tiles are actually gray, (127, 127, 127, 1.0). This is what causes a problem... how do we colorize that properly?

Re: MapMatic +2

Posted: Sat Jun 17, 2017 1:51 pm
by Clever_Munkey
Change all grey to (0,0,0) and then have the program set the color to (127, 127, 127, 1.0) by default? If a color was already defined in the line, then don't set it to grey.

Every tile that has grey with a black outline would lose their outline. To fix that we would have to create an image that is just the outline. Some already have this (angled walls) others don't (castle walls, window, arch, etc). Honestly I like the idea of being able to manipulate the outlines separately, but it requires more work.

Re: MapMatic +2

Posted: Thu Sep 13, 2018 10:45 am
by chiisu81
How do we view maps on +2? Right now I have to download the .map file and paste that code into +1 to get the PNG. +2 gives this error:
Traceback (most recent call last):
File "/var/www/mapmatic.basicfantasy.org/html/index.cgi", line 13, in <module>
mapmatic2.main("../lib")
File "../lib/mapmatic2.py", line 789, in main
img.save(name, "png")
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1725, in save
fp = builtins.open(filename, "w+b")
IOError: [Errno 13] Permission denied: 'maps/1536853368.59.png'

Re: MapMatic +2

Posted: Thu Sep 13, 2018 7:57 pm
by Solomoriah
Well, after I fix the permissions of the entire MapMatic +2 directory tree on the server, it all works much better...

Re: MapMatic +2

Posted: Mon Sep 17, 2018 10:09 am
by chiisu81
Yes it does, thanks! 8-)

Re: MapMatic +2

Posted: Fri Sep 21, 2018 10:19 am
by chiisu81
Any (easy) way the rendered PNG can be at 200 DPI rather than 150? That seems to be the min that doesn't have any blur in LO at a full page.

Re: MapMatic +2

Posted: Fri Sep 21, 2018 2:37 pm
by Solomoriah
I chose 150 dpi as it makes sharp images at the sizes I need; rather than 200 dpi, why not change it to 300 dpi? Simply resize the final image using Gimp (or whatever image editor you use) to 200% with interpolation set to "none" and the result will be double-sized, sharp-edged little squares, just as required; just remember to set the DPI to 300 at the same time.

Re: MapMatic +2

Posted: Sun Feb 24, 2019 6:24 pm
by Solomoriah
Okay, so I've updated MapMatic +2 in a couple of ways.

First, the "targets" for the rotation, flip, and mirror links are larger, so they're easier to hit. This does mean the center of the tile, where you click to add additional bits, is smaller and thus harder to hit, but I think it's a fair tradeoff.

Second, I've added targets for - (delete) and x (clear) on the left and right of the selected square. Delete removes the last tile added, while clear empties the square.