GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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:
Image (png)
Image (gif)
Image (jpg)
Last edited by T.M. on 06 Dec 2011, 20:04, edited 3 times in total.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by T.M. »

oh my god! transparent gif works now :shock:

Image
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by Cuban-Pete »

so what will become standard setting? gif? because of quicker generating and smaller file size?
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by T.M. »

phew, fixed everything now, filetype changeable:
http://epicgta2.omnitude.net/gta2text/

its a bitch to debug PHP, especially PHP images.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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!
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by Cuban-Pete »

is it even faster if you load also from gif (and save as gif)?
Attachments
gta2font_normal_sc0.png
gta2font_normal_sc0.png (3.44 KiB) Viewed 24913 times
gta2font_large.png
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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? :-)
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by Cuban-Pete »

me est noob à php.

if I convert them for you, will you try it?

//edit now ok?
Attachments
gta2font_large.png
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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 :D 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.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by T.M. »

i noticed the PNG is smaller in filesize for that large font, not much though, around 10% smaller maybe.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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:
fonts gif.7z
(209.09 KiB) Downloaded 515 times
//hhmm the images contain bugs in edges because of bad transparent convert. just use for testing speed!!!! [frenzy] [frenzy]
Last edited by Cuban-Pete on 06 Dec 2011, 20:54, edited 2 times in total.
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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:
Image
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

Image
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
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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
paintshopproexample.png (10.77 KiB) Viewed 24906 times
although sometimes i need to choose "error diffusion" (if theres too many colors, the gradients will look bad).
Last edited by T.M. on 06 Dec 2011, 21:02, edited 1 time in total.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by Cuban-Pete »

I used Irfanview Batch tool. It lacks super control...

// I can turn on "save interlaced"
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by T.M. »

hmm, maybe i could simply load the PNG's in my PHP script and output them as GIF's? :D

DONT never use interlaced. :shock:
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post by Cuban-Pete »

interlaced... hmmm.... might be useful for the web. people in poland have bad connection speed :P
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] goodnight
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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 :D

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
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Post 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++.
Post Reply