Author Topic: Final Fantasy VIII - Graphical Update Mod (WIP)  (Read 8702 times)

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #25 on: 2019-01-09 18:55:12 »
I need to tweak my tools a bit as FFVIII is a bit different then IX, but still, give it a try.
https://www.dropbox.com/s/dlro1jql2wcovmb/FF_8_mask_test.rar?dl=0

I've included the upressed version, the cut version and the AI base png.

Tell me what you think of the masks.

satsuki

  • Crazy poster
  • *
  • Posts: 203
  • Karma: 35
    • View Profile
    • My softs (french only)
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #26 on: 2019-01-09 19:09:49 »
I don't know if you came up with this process on your own, but buddy, if you did - my hat's off to you. You got mad skills with image manipulation and I thank you for sharing them. :)
...
I still need to implement this into my process, but I'd say my masking issues are solved, this is awesome. I don't know how you figured this mess out, but it works pretty darn good.
....
Thanks.
Yes it's a full process on my own.

By the may i think anyone how realy master imagemagik can probably do the same with less steps and without potrace, i just use many steps because it was easyer for me to understand and debug ^^, so no mastering but some try and die and RTFM of imagemagik ^^.

To avoid black pixels masking issues i merge potrace with a 400% un-interpoled mask, If ff8 don't need this you can try out without de 400% mask merged and the result will be even better.

To my mind, sharing skills is the most important part of the life, is anyone can share is skill freely, the workd will be realy better than it is now ....

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #27 on: 2019-01-09 19:11:18 »
I need to tweak my tools a bit as FFVIII is a bit different then IX, but still, give it a try.
Tell me what you think of the masks.

It's not bad, it certainly has less jaggies, but as is, it's not a perfect match and leaves transparency holes in the image which clearly won't work.
I tried to do like you described as well on my own, but I can't get it to fit properly either, I wouldn't mind seeing the script though, I might be able to figure something out if I had a base to work with, otherwise I'm just kind of guessing and it could take forever to find something that works with all the options available even with only the few basic steps you described, it leaves a lot to the imagination. I'm not sure how you ever got this to work tbh, but certainly like the idea of it.

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #28 on: 2019-01-09 19:22:54 »
I'm using a new gimp version where the algorithm is slightly different. I can give you my two scripts that I use and normally no holes should be visible.

Like I said, FF III is a bit different and gimp uses another upres algorithm.
I just wanted your opinion on general. If you like it, maybe you can tweak it a bit or use another gimp version for the old upres algorithm. :)

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #29 on: 2019-01-09 19:26:02 »
Thanks.
Yes it's a full process on my own.

By the may i think anyone how realy master imagemagik can probably do the same with less steps and without potrace, i just use many steps because it was easyer for me to understand and debug ^^, so no mastering but some try and die and RTFM of imagemagik ^^.

To avoid black pixels masking issues i merge potrace with a 400% un-interpoled mask, If ff8 don't need this you can try out without de 400% mask merged and the result will be even better.

To my mind, sharing skills is the most important part of the life, is anyone can share is skill freely, the workd will be realy better than it is now ....

Honestly, it's been so long since I used imagemagick, that I had to look up reference notes just to get a basic idea of what was happening and my first few attempts left me shaking my head trying to figure out what I was doing wrong. I still need to go over the script I made to fine tune it as well, I would love if you went over it if you're still familiar enough with imagemagick, you might notice some things I could easily alter.

I altered it a bit since our 'goals' were clearly different I think. I simply just wanted to produce a mask image, while I believe your original script actually merged it with the background in the end. So there's a few things I'd like to change. I'll figure it out on my own if it's been a while or it's too much of a hassle, but like I said, if simply taking a peek at what I've done you can easily notice some stuff, you could save me a headache or two ;-P

Code: [Select]
@echo off
set infile=%1
set blackImage=%2
set workArea=workArea
set bwavector=%workArea%\bwavector.bmp
set eps=%workArea%\bwavector.eps
set vector4x=%workArea%\vector4x.bmp
set vector4xblack=%workArea%\vector4xblack.png
set raw4x=%workArea%\raw4x.png
set raw4xcoupe=%workArea%\raw4xcoupe.png
set raw4xmix=%workArea%\raw4xmix.png
set raw4xbackmix=%workArea%\raw4xbackmix.png
set fullblack=%workArea%\fullblack.png
set calquedecoupe=%workArea%\calquedecoupe.png
set box25p=%workArea%\box25p.png
set x4novi=%workArea%\x4novi.png
set combi=%workArea%\combi.png
set mask=mask.png

cmd.exe /c start /B /wait /low " " convert -fill black -colorize 100%% -flatten %infile% %bwavector%
cmd.exe /c start /B /wait /low " " potrace --turdsize 0 %bwavector% -o %eps%
cmd.exe /c start /B /wait /low " " convert -density 288 -background #FF00FF -channel alpha -threshold 70%% -alpha remove -flatten %eps% %vector4x%
cmd.exe /c start /B /wait /low " " convert  +transparent #000000 %vector4x% %vector4xblack%
cmd.exe /c start /B /wait /low " " convert -scale 400%% -background #FF00FF -alpha remove -alpha off -fill black +opaque #FF00FF %infile% %raw4x%
cmd.exe /c start /B /wait /low " " convert +transparent #FF00FF %raw4x% %raw4xcoupe%
cmd.exe /c start /B /wait /low " " composite -gravity center %raw4xcoupe% %blackImage% %raw4xmix%
cmd.exe /c start /B /wait /low " " convert -alpha remove -alpha off +transparent black %raw4xmix% %raw4xbackmix%

cmd.exe /c start /B /wait /low " " composite -gravity center %raw4xbackmix% %vector4xblack% %fullblack%
cmd.exe /c start /B /wait /low " " convert -background #FF00FF -alpha remove -alpha off -transparent #000000 %fullblack% %calquedecoupe%

cmd.exe /c start /B /wait /low " " convert -define png:format=png32 -fuzz 01%% -fill #FE00FE -opaque #FF00FF %blackImage% %x4novi%
rem cmd.exe /c start /B /wait /low " " composite -gravity center %calquedecoupe% %x4novi% %combi%
rem cmd.exe /c start /B /wait /low " " convert -define png:format=png32 %combi% -transparent #FF00FF %mask%
cmd.exe /c start /B /wait /low " " composite -gravity center %calquedecoupe% %x4novi% -negate %mask%

The two arguments I send it are the original file I'm masking and a black image the same size of that image, due to what I did to change it, I'm guessing there are steps here I can completely skip, since I'm only after the mask, which I'll then use in my own python script. I know it's still a bit messy, it produced what I wanted and haven't worked on it since, but I'm guessing there are things I could do/steps to take out that would speed it up. I tried to make sense of what you were doing, but tbh, I'm completely lost. I have no idea how this works.

Either way, good job, it's not perfect, but it's definitely better than what I was using, and the best part is that I can apply it to all the images.

I also completely agree with you about sharing info for sure. I haven't shared much about what I've done so far simply because it's still all kind of a mess, but when I'm done I'm sure I'll also post my python code and whatever else my process was so that others can use it if it's at all helpful, hell maybe it will just help someone with something completely unrelated, or in a couple of years a new filter will come out and someone will want to rebuild the screens again and for all I know what I've done/documented might help them along, which is great. And maybe no one would even care either, which is fine. haha

I do this for me more than anything, because I enjoy it, even I fail in the end or the results aren't as good as someone else's. I'll learn stuff along the way, with this project, I'm mostly learning about using python with GIMP, which tbh, has been a really good learning experience, especially since I had never even used python before this. :P

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #30 on: 2019-01-09 19:28:40 »
I'm using a new gimp version where the algorithm is slightly different. I can give you my two scripts that I use and normally no holes should be visible.

Like I said, FF III is a bit different and gimp uses another upres algorithm.
I just wanted your opinion on general. If you like it, maybe you can tweak it a bit or use another gimp version for the old upres algorithm. :)

I initially began with the latest GIMP as well myself, but there are definitely some changes in it that were messing with my filter process so I went back to 2.8. But I will say this for the new gimp, it's WAY faster, so once all this is done and over with, I'm excited to give it another go.

Ya, I would definitely love to see the scripts though, even if they don't help me now with what I'm doing, I might learn something from them :P

satsuki

  • Crazy poster
  • *
  • Posts: 203
  • Karma: 35
    • View Profile
    • My softs (french only)
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #31 on: 2019-01-09 19:40:38 »
The part you can try to skip is the :
Code: [Select]
cmd.exe /c start /B /wait /low " " convert -scale 400%% -background #FF00FF -alpha remove -alpha off -fill black +opaque #FF00FF %infile% %raw4x%
cmd.exe /c start /B /wait /low " " convert +transparent #FF00FF %raw4x% %raw4xcoupe%
cmd.exe /c start /B /wait /low " " composite -gravity center %raw4xcoupe% %blackImage% %raw4xmix%

You'll get a way better mask, but if ff8 is as rigid than ff7 with the layering, you may have missing pixels
The other parts of your code seems right to me, maybe not speed optimized as imagemagik can chain lots of action in one command, but this type of optimisation is not my cup of tea ^^'

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #32 on: 2019-01-09 19:52:26 »
The part you can try to skip is the :
Code: [Select]
cmd.exe /c start /B /wait /low " " convert -scale 400%% -background #FF00FF -alpha remove -alpha off -fill black +opaque #FF00FF %infile% %raw4x%
cmd.exe /c start /B /wait /low " " convert +transparent #FF00FF %raw4x% %raw4xcoupe%
cmd.exe /c start /B /wait /low " " composite -gravity center %raw4xcoupe% %blackImage% %raw4xmix%

You'll get a way better mask, but if ff8 is as rigid than ff7 with the layering, you may have missing pixels
The other parts of your code seems right to me, maybe not speed optimized as imagemagik can chain lots of action in one command, but this type of optimisation is not my cup of tea ^^'

awesome, thx, that's helpful, I gotta go pick up my kid now, but I'll definitely try to make that change later as soon as I can :)

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #33 on: 2019-01-10 11:38:58 »
Post your resluts please as I#m maybe also opting to use that instead of my workflow for masking. :)

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #34 on: 2019-01-10 13:49:17 »
Unfortunatley, I still haven't gotten a chance to play with the script again, but a quick look shows that later lines in the code require the results of the lines Satsuki recommended I remove, so I'll have to do some testing with it first. I've been continuing testing out new methods in GIMP similar to what you've described, and have gotten some really nice results, but like you, always seem to end up with some holes in the image some where. I'm about to try messing around with that script again though and try to fine tune it as well as modify it if I can with some of the techniques I've been playing with in gimp, with a little luck I'll have an even better script soon, but if not, at least a more refined one if that's possible. Until then, that script I posted works perfectly fine as is tbh, and it really doesn't take long to run it (my filter takes much longer, so this is just an extra minor step tbh).

l8r :)

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #35 on: 2019-01-11 13:19:02 »
I just tried my scripts with Gimp 2.8 and ther're no holes there.
I hate the new algorithm in 2.9.

Well, here is the result.
Tell me if it's okay for you.

https://www.dropbox.com/s/dsd2ejuglrh36e9/FFVIII_Masktest_V2.psd?dl=0

Here's also my two scripts that I use after upressing:

https://www.dropbox.com/s/hdjr3dacff6237m/anim-settings-semiflatten.scm?dl=0
Filter Animations -> Semiflatten -> Settings with Semi Flatten -> Collor HTML Code: FF00FF
Leave everything else as it is.

Afterwards use this one
https://www.dropbox.com/s/vl2emavqxmkzusw/Delete%20alpha%20seams.py?dl=0
PKHG -> Select by Color -> Select by Color
Normally the Color should be automatically set to FF00FF. If not, set it to that and click ok.

After that you should heave many pink lines/seams.
Select from Alpha, copy from the ESRGAn image and paste it as a new Layer.
Do that four times and you have your layers without any holes if you use Gimp 2.8 with 400% Sin (Lanczos3) algorithm.

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #36 on: 2019-01-11 14:31:56 »
nice, that sounds promising. I played with that script a little yesterday but not much and didn't really make any progress. I got a buddy coming over today that I haven't seen in a while, so I'm not expecting to get much done today either unfortunately, but I will certainly take a look at those scripts you posted. they might identify what I've been lacking in my attempts also. I'm pretty sure the 'heart' of Satsuki's script is that gravity filter he was using, but haven't noticed it 'work' yet. I don't know of a way to get gimp to run a filter like that, but if I combine what you came up with with satsuki's script I might be able to come up with a less blocky mask (at least that's what I'm currently hoping).

thx :)
« Last Edit: 2019-01-11 14:45:51 by blippyp »

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #37 on: 2019-01-11 14:39:40 »
Satsuki, can you also give the FFVIII background a go? I want to see if your way of masking result in a fiber/better mask then my technique.

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #38 on: 2019-01-11 14:45:58 »
image looks solid btw, can't wait to look at this further, if I can apply the techniques I've been using, I think I can generate a much nicer mask if I can figure out how to close those holes. this is an example of what I've been coming up with so far (compare the paddle - it's really coming out nice)



This mask isn't perfect and clearly needs to be cleaned up on the edges, I just pulled from one of the images I had in my gimp window atm, one of the images I was playing with yesterday, so I've been producing very similar masks, but when placed together I get those holes, so have been trying to figure out how to stop that.

Satsuki, can you also give the FFVIII background a go? I want to see if your way of masking result in a fiber/better mask then my technique.

I already posted using his technique, unless I messed up the script or simply did something wrong (it's the last message on the previous page). He didn't mention anything was wrong about it, so I'm guessing it's about what he would of expected.

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #39 on: 2019-01-11 14:47:47 »
Can you post a psd file of that so I can have a look on it or was it multilayered tiff?

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #40 on: 2019-01-11 14:53:35 »
I closed the window with all the layers I had (since it was a failure), give me a second and I'll see if I can re-produce the mess I came up with yesterday.

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #41 on: 2019-01-11 15:03:00 »
Can you post a psd file of that so I can have a look on it or was it multilayered tiff?

Mega Link

I think if I applied what Satsuki had going on with this, perhaps it would work. But I still don't fully understand how his process worked to make it seamless. At the same time though, I'm surprised it turned out as blocky as it was with potrace as the base also (which was probably a lot straighter than what I just produced).

The problem with how I did it though is that it might be impossible to make it seamless this way. One possible solution I came up with however, was to merge all the masks together when all is said and done, to determine what 'is left to mask', then merge that with one of the images that is purely part of the background (ie: no characters walk behind it). I'm not sure how Pupu works for re-creating the images though or if that would cause a problem, plus you would need to identify a 'pure' background image for every screen, which may not be possible. In the end, it would just be too much of a headache, if not even possible at all. Unfortunately, I'm not very familiar with scheme however so I'm not sure how much your scripts will help me. I initially tried scripting in scheme with GIMP a couple of years ago and got such a headache that I jumped for joy when I realized that you could use python instead, which I still didn't know, but was way more like how I'm use to coding.
« Last Edit: 2019-01-11 15:21:37 by blippyp »

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #42 on: 2019-01-11 15:42:32 »
Okay, I think I figured this out - but I certainly need to play with it to find a better 'middle ground'.

Look at the paddle in this image - In order to close the 'gaps' I selected more of the white background pixels to 'grow' (originally I was only growing it by one), in this image I had it at 6, which still left a couple of visible masking pixel holes here and there, so I'm assuming 7 would of completely solved this. However, clearly the mask around the paddle is now too big, even in this image. So what I'll have to decide on is how 'less straight' I want those lines to be, which SHOULD (I believe) allow me to choose a smaller number to increase my white pixels at. I'll definitely play with this again later and post my results, but I think I figured this out now.


blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #43 on: 2019-01-11 16:27:39 »
Alright, so I think this is what I'm going to end up going with. I don't think there's any chance of a 'perfect' mask given what we're trying to do, but it's certainly better than the blocky mess I was using earlier, whether it's better than Satsuki's method or not is hard to say, it's certainly smoother, but his blocky approach has benefits as well imo. (FYI: by 'blocky mess' I was not referring to Satsuki's approach, but my own original one haha - STILL MANY THANKS to Satsuki for introducing me to his method, and sharing his approach, without it, I wouldn't have been able to use potrace for this, since I wasn't even aware of it!)

Mega Link for PSD with all layers



Steps used: (I'm sure this can be altered to simply resizing to 400%, in which case how many pixels used to expand the mask at may change to 4 or 3, you'd have to play with it, and it's what I will likely do, since I don't think it's necessary to go to 800%)

  • create a potrace of the original image (a vector image), which I generated a gimppath file
  • copy original mask, import the gimppath
  • resize to 800%
  • fill selection with black then invert selection
  • expand selection by 5 pixels
  • fill with white
  • resize 50% copy/paste the mask

also, if you don't bother altering this and end up resizing from 800% to 400%, make sure you use NONE as your interpolation method when resizing the image so that you don't end up with any grey pixels.

of course, I won't know for sure if this will have issues until I try to implement it, but it at least seems to work with this particular scene.
« Last Edit: 2019-01-11 16:45:12 by blippyp »

kennybones

  • Fast newbie
  • *
  • Posts: 29
  • Karma: 2
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #44 on: 2019-01-11 23:54:14 »
Love the clean cuts! Looks almost manually done

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #45 on: 2019-01-12 08:02:08 »
Thx, unfortunately, I gave this a test in game and it doesn't work. Satsuki's method is way way better, so I'm going with his method instead.

Fraggoso

  • Insane poster
  • *
  • Posts: 257
  • Karma: 12
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #46 on: 2019-01-12 08:52:03 »
What's the problem ingame? The mask looks really clean. :/

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #47 on: 2019-01-12 09:03:13 »
What's the problem ingame? The mask looks really clean. :/

Unfortunately there are a couple issues that appear as you can see. One of those issues can likely be fixed if I can figure out why it's happening, but despite that, the overall effect is much worse. The masking doesn't match closely enough in game and looks 'lame' for lack of a better word. As you can see in the image below. For whatever reason, there's an odd overlapping of the masks, which I can't figure out why, not that I made any real attempt to figure it out yet though because the overall 'poor' masking ruins it for me in the end. Compare with the same image below it where I used my modified script from Satsuki. It's blockier, but the masking matches and is still cleaner than my original masking attempts, so I'm just going to go with his script.

My previously posted mask:


Using a modified script from Satsuki:

satsuki

  • Crazy poster
  • *
  • Posts: 203
  • Karma: 35
    • View Profile
    • My softs (french only)
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #48 on: 2019-01-12 09:51:40 »
Yes it seems ff8 use the same "strick layer system" than ff7 is, what's why you need potrace + non interpolated resize mixed to avoid missing pixels and layer collisions.
It's not perfect on some screens and you'll have to do smalls correction but that's the only way i found to have a correct render in ff7.
Great it have helped you, hopped you found a better way for ff8

blippyp

  • Cool newbie
  • *
  • Posts: 96
  • Karma: 6
    • View Profile
Re: Final Fantasy VIII - Graphical Update Mod (WIP)
« Reply #49 on: 2019-01-12 13:29:14 »
Yes it seems ff8 use the same "strick layer system" than ff7 is, what's why you need potrace + non interpolated resize mixed to avoid missing pixels and layer collisions.
It's not perfect on some screens and you'll have to do smalls correction but that's the only way i found to have a correct render in ff7.
Great it have helped you, hopped you found a better way for ff8

Woah woah woah! Hold on a second - Are you telling me that you aren't providing a guarantee with this!?!??  haha ;-P

It's cool, don't worry I won't come back yelling at ya! The fact that you already (as far as I understand it) produced an update for FFVII using this technique tells me that it's pretty solid, even if there are a few "gotcha's" along the way. I'm sure the end result will still be better than simply upscaling the original masks (which given my previous video post, was horrible tbh). I know this isn't perfect either, but it's the best solution I have atm and I'm still very thankful to have it :)