• Sign up for TFS Icon Competition! The prize includes Otland Premium time and a medal, as well as obviously taking part in TFS history.
  • There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[DISCUSSION] 128x128 pixels Tibia sprites with AI (neural network)

Kazz Kzupzarski

New Member
Joined
May 22, 2018
Messages
2
Reaction score
0
On windows I only compiled it in CodeBlocks some time ago. Now I use Linux at work and there it's very easy to compile.

#topic
Just bought GeForce 1080Ti. Now it will learn 3 times faster then on 1050. I should get some results in 3-5 weeks.

Can you build JSkalskiSBG SPR_from_PNG otclient windows lastest version?
I'm trying build on CodeBlocks, but there are compiling errors.

Att,
Kzpk.
 

GhostWD

I'm in love with the var_dump()
Joined
Jan 25, 2009
Messages
185
Solutions
6
Reaction score
28
Maybe stop only increasing resolution and let's change format? maybe use .svg? this would be great! ( that's my dream <3 ). what do you think guys? possible?
 

tiagomelojuca

Member
Joined
Apr 18, 2021
Messages
9
Reaction score
5
Location
Brazil
GitHub
tiagomelojuca
Can you build JSkalskiSBG SPR_from_PNG otclient windows lastest version?
I'm trying build on CodeBlocks, but there are compiling errors.

Att,
Kzpk.
Precompilled binaries for Windows 64bits:
Download: https://www.dropbox.com/s/7uhdnccvgflnchr/otclient_hr-x86_64.zip?dl=1
Scan: VirusTotal (https://www.virustotal.com/gui/file/77d53e11d62af9a320c2d9a8362c5b4ed4a88ec211f8d62eff8a3e92114290d8/detection)

Providing precompilled binaries just for the sake of convenience. All you need is in USAGE.md

Hope it encourage someone in this achievement... this thread is too good to die :(
Unfortunally, it's so underrated, even being one of the best ones I've saw about Open Tibia over the last years.

Greate work as always, @Gesior.pl ... Big fan of yours here. Thanks for everything :)
Post automatically merged:

Almost forgot... if it helps anyone, here is a simple script I've done for myself in NodeJS for generating 64x64 placeholders (simple resizing) taking the 32x32 extracted folder as input:

JavaScript:
const fs = require('fs');
const path = require('path');
const sharp = require('sharp'); //^0.28.1

// Definitions
const PATH_IN = path.resolve(__dirname, 'sprites_1');
const PATH_OUT = path.resolve(__dirname, 'sprites_2');

// Functions
const getFilepathIn = fileName => path.resolve(PATH_IN, fileName);
const getFilepathOut = fileNameWithoutExt => path.resolve(PATH_OUT, `${fileNameWithoutExt}.png`);
const getBufferIn = fileName => fs.readFileSync( getFilepathIn(fileName) );

async function resizeImgBuffer(inputBuffer, finalHeight) {
    return await sharp(inputBuffer)
        .resize({
            width: finalHeight,
            kernel: sharp.kernel.nearest,
        })
        .png()
        .toBuffer();
};

async function createOutputBufferFromInputPNG(fileNameWithoutExt) {
    const inbuf = getBufferIn(`${fileNameWithoutExt}.png`);
    return await resizeImgBuffer(inbuf, 64);
};

async function resizeFile(fileNameWithoutExt) {
    fs.writeFileSync(
        getFilepathOut(fileNameWithoutExt),
        await createOutputBufferFromInputPNG(fileNameWithoutExt)
    );
};

// Resize all files inside input dir
(async () => {
    if ( !fs.existsSync(PATH_OUT) ) fs.mkdirSync(PATH_OUT, { recursive: true });
    const inFiles = fs.readdirSync(PATH_IN);
    const inFilesWithoutExt = inFiles.map( item => item.slice(0, -4) );
    
    for (const [id, fileName] of inFilesWithoutExt.entries()) {
        await resizeFile(fileName);
    };

    console.log('Finished!');
})();

Just place it in same dir of your sprites' extracted folder and, after renaming it for sprites_1, run a
Bash:
yarn init -y && yarn add sharp
, then you're ready to go (
Bash:
node ./script.js
).
 
Last edited:

Dip Set

Active Member
Joined
Dec 27, 2007
Messages
117
Solutions
1
Reaction score
45
@mrianuraa and I spent >1 week on this (literally took 1 week to convert tibia.spr 300 mb to all png images >2.5GB. The png folder was able to compress to 350~ mb. In the end, it was very nice graphics when standing still, however upon movement there was tremendous lag at times. Mrianuraa attempted to optimize the client, but in the end it was still causing lags.
 
Top