Page 16 of 19
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 18:21
by T.M.
it is white now

nice size difference btw. maybe the rendering becomes faster purely because the files are smaller.
im getting pissed off at this gif thing; the gif background color is always 252,254,252 when it should be 255,255,255 and it should be transparent too! >_<
edit: fonttest:

(png)

(gif)

(jpg)
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 18:27
by T.M.
oh my god! transparent gif works now

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 18:32
by Cuban-Pete
so what will become standard setting? gif? because of quicker generating and smaller file size?
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 18:34
by T.M.
i think yes. but gif may not be supported on all servers, so i need to make it trickier... updating index soon.
gif isnt better just for smaller/quicker, but also for compatibility (old IE (and possibly other browsers) doesnt show PNG transparency).
GIF wins every image, i think, test from biggest/colorfullest image:
Output image filesize: 65.2 KB (65150 bytes)
Create GIF: 14.9 ms
Output image filesize: 260.6 KB (260625 bytes)
Create JPG: 23.9 ms
Output image filesize: 74.4 KB (74425 bytes)
Create PNG: 55.5 ms
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 18:46
by Cuban-Pete
I think it is because png has an algorithm (like zip) to make file size smaller and gif is just simple "array" of colours. for these strange graphics the png algorithm is not beneficial.
nvm, gif is also with algorithm
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 19:20
by T.M.
phew, fixed everything now, filetype changeable:
http://epicgta2.omnitude.net/gta2text/
its a bitch to debug PHP, especially PHP images.
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 19:25
by T.M.
can you make 256 colored white+transparent PNG version for the large font too?
i noticed the GIF generated colors are weird (with the large font), somehow optimized i guess. im hoping the 256 version would fix it to be exacly like it should be, since you used 266 colors instead of 256 (in the large font) so it must calculate own palet for it (might make slower too!).
edit: i dont think i need to change the normal font images to 256 color; didnt see any performance boost. i think i wont even bother making 256 colored PNG since GIF does it as good, and PNG would generate slower probably. BUT i still would like that large font into 256 colored white+transparent image!
edit2: packed the URL even tighter!
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:23
by Cuban-Pete
is it even faster if you load also from gif (and save as gif)?
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:29
by T.M.
Hmm,, loading from gif, havent tested, its just... im lazy of converting 36+3 images into GIF :S and i actually cant even do that with my programs
Im using your title image if you dont mind:
http://epicgta2.omnitude.net/gta2text/? ... funny+test
BTW; why type the year at all when the computer can do it for you?
Code: Select all
print"( ".date("Y")." - Version {$VERSION_STR} )";
And its always up to date!
--
edit: that large font background isnt white! can you make it white please?

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:33
by Cuban-Pete
me est noob à php.
if I convert them for you, will you try it?
//edit now ok?
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:36
by T.M.
thx, yeah sure if you can do it.
damn that large font is now less than 50% of the 24bit image filesize!
edit: seems to look better too, .... or not, well you cant really see the difference

previously it made weird pixels where should have been only 1 color, now it doesnt, so thats good. but it still seems to scale down the colors to 165 or something.
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:49
by T.M.
i noticed the PNG is smaller in filesize for that large font, not much though, around 10% smaller maybe.
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:52
by Cuban-Pete
yeah, but generate time is huge difference:
compare this:
http://epicgta2.omnitude.net/gta2text/g ... &png&debug
to this:
http://epicgta2.omnitude.net/gta2text/g ... ..&z&debug
I made the gif images:
//hhmm the images contain bugs in edges because of bad transparent convert. just use for testing speed!!!!
![[frenzy] [frenzy]](./images/smilies/powerups/frenzy.png)
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:53
by T.M.
ROFL:
Create PNG: 70.9 ms
Create GIF: 12.7 ms
INDEED IT IS.
testing gif soon.
gotta benchmark first all those fonts:

Output image filesize: 65.2 KB (65150 bytes)
Time taken to:
Render font: 54.9 ms
Create GIF: 15.4 ms
Free resources: 0.2 ms
Total: 70.5 ms

Output image filesize: 130.5 KB (130458 bytes)
Time taken to:
Render font: 11.2 ms
Create GIF: 17.8 ms
Free resources: 0.1 ms
Total: 29.1 ms
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 20:58
by T.M.
how (in means of what did you do) did you mess up the palets? what program are you using? you should disable dithering.
edit: here is how i always save GIF's with no problems:

- paintshopproexample.png (10.77 KiB) Viewed 32068 times
although sometimes i need to choose "error diffusion" (if theres too many colors, the gradients will look bad).
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 21:01
by Cuban-Pete
I used Irfanview Batch tool. It lacks super control...
// I can turn on "save interlaced"
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 21:02
by T.M.
hmm, maybe i could simply load the PNG's in my PHP script and output them as GIF's?
DONT never use interlaced.

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 21:17
by Cuban-Pete
interlaced... hmmm.... might be useful for the web. people in poland have bad connection speed
An interlaced GIF (Graphics Interchange Format) is a GIF image that seems to arrive on your display like an image coming through a slowly-opening Venetian blind. A fuzzy outline of an image is gradually replaced by seven successive waves of bit streams that fill in the missing lines until the image arrives at its full resolution. Among the advantages for the viewer using 14.4 Kbps and 28.8 Kbps modems are that the wait time for an image seems less and the viewer can sometimes get enough information about the image to decide to click on it or move elsewhere. For users with faster connections, there is little difference in effect between an interlaced GIF and a non-interlaced GIF.
//
![[sm-01] [sm-01]](./images/smilies/penguins/sm-01.gif)
goodnight
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 21:21
by T.M.
interlaced is a bad idea for the font files, it
might be good idea for the text generator output images, but i dont even know how to set those settings in PHP. and tbh i dont want to
I was able to convert everything else except the normal font o_O
"Invalid LZW code encountered in file."
it even generated GIF file with OK looking data, but i cant open the files :S
Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)
Posted: 06 Dec 2011, 21:45
by T.M.
what the fuck? i could load the GIF inside my browser, and then save from browser and the GIF magically gets fixed! it adds some bytes here and there; i think its about the width of the image: street/car/large font image widths are not divisible by 2, but the normal font is. i'll see if it works when i add 1 more pixel width in the normal font o_O
edit: doesnt seem to do with widths. i think it just fails to load the GIF for some other weird fucking reason.
edit: GOT IT WORKING! stupid globals... again. argh. PHP globals sucks ass, doesnt work at all like in c++.