Has anyone tried kirby's Epic Yarn? That game has a ton of high detail textures, at low res, and almost seems like a perfect use case for this.
Give waifu2x-caffe a try for smoothing over JPEG artifacts. Been using the Photo model at Level 2 mostly (Level 3 for video frames).Finally got around to playing with this. I just finished going through my 12+ year old hard drive files and upscaled a bunch of old to incredibly old images.
It is really bad with JPEG compressed images, because the upscaling of the JPEG artifacts can make the output image go really crazy. It's also not great for anything pixelated, including things like the edges of the ball texture in the Mario 64 example posted above. But for clean images (e.g. all the video game textures here), it works really well.
Too bad my old pictures are all JPEG compressed to heck, though lol. I wonder how we dealt with that back in the day...
Decided to try it because I have Dolphin readily available.Has anyone tried kirby's Epic Yarn? That game has a ton of high detail textures, at low res, and almost seems like a perfect use case for this.
Java:package pngTransparencyDetector; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileFilter; import java.io.IOException; import javax.imageio.ImageIO; public class TransparencyDetector { public static void main(String[] args) { System.out.println("This program checks all .png files in this directory"); System.out.println("and deletes any files that have any transparent pixels."); //If you want to use this program on the command line // File workingDirectory = new File(System.getProperty("user.dir")); //if you just want to hardcode the directory... File workingDirectory = new File("D:\\dev\\machinelearning\\ESRGAN\\LR"); System.out.println("Working Directory = " +workingDirectory); //filter files File[] files = workingDirectory.listFiles(new FileFilter() { public boolean accept(File file) { return (!file.isDirectory() && file.getName().toLowerCase().endsWith(".png")); }}); mainLoop: for (int i = 0; i < files.length; i++) { System.out.println("Processing " + (i+1) + " of "+ files.length+" "+ files[i].getName()); BufferedImage pngImage = null; try { pngImage = ImageIO.read(files[i]); } catch (IOException e) { System.out.println("Failed to open file."); e.printStackTrace(); continue; } for (int height = 0; height < pngImage.getHeight(); height++) { for (int width = 0; width < pngImage.getWidth(); width++) { int pixel = pngImage.getRGB(width, height); int a = (pixel & 0xFF000000) >>> 24; int r = (pixel & 0xFF0000) >>> 16; int g = (pixel & 0xFF00) >>> 8; int b = (pixel & 0xFF); if (a != 255) { System.out.println("Deleting file..."); files[i].delete(); continue mainLoop; } } } } System.out.println("Finished!"); } }
Give waifu2x-caffe a try for smoothing over JPEG artifacts. Been using the Photo model at Level 2 mostly (Level 3 for video frames).
They should try it on your avatar!Wow, these all look amazing. Could this program finally make Yoshi Story look as beautiful as it was meant to??
Holy moly. Nice work, Ze_PilOt! Wish SE had done something like this for the PS4 (and upcoming Switch/XBox One) ports of FF VII and IX. Do that and patch the music bugs, and we don't even need remakes. I'll pay full price again, just like 20 years ago.
Finally got around to playing with this. I just finished going through my 12+ year old hard drive files and upscaled a bunch of old to incredibly old images.
It is really bad with JPEG compressed images, because the upscaling of the JPEG artifacts can make the output image go really crazy. It's also not great for anything pixelated, including things like the edges of the ball texture in the Mario 64 example posted above. But for clean images (e.g. all the video game textures here), it works really well.
Too bad my old pictures are all JPEG compressed to heck, though lol. I wonder how we dealt with that back in the day...
At work so sorry if obvious, but is this for the PC version? Any incompatabilities with different regions? e.g. Japanese version
So the guy who work on the upscale give a "beta" version of his mod to a streamer and he currently stream it on twitch (In French):
This is looking good.
Okay, I did what I said above at the end of my post above to also upscale the transparent textures. Now every texture in these scenes should be upscaled.
Here's the results:
Orginal image:
https://i.imgur.com/fDTMlEx.png
New image:
Original image:
https://i.imgur.com/42QmnY9.png
New image:
And a third image that I didn't get a comparison shot for:
I think it looks pretty good. I actually upscaled the transparent textures and the transparencies themselves all with ESRGAN, and I'm a little surprised it turned out well. I'm gonna look into trying out some other games now.
Waifu2x-caffe can handle transparencies if you want to avoid the manual process of doing it yourself with ESRGAN.Okay, I did what I said above at the end of my post above to also upscale the transparent textures. Now every texture in these scenes should be upscaled.
Here's the results:
Orginal image:
https://i.imgur.com/fDTMlEx.png
New image:
Original image:
https://i.imgur.com/42QmnY9.png
New image:
And a third image that I didn't get a comparison shot for:
I think it looks pretty good. I actually upscaled the transparent textures and the transparencies themselves all with ESRGAN, and I'm a little surprised it turned out well. I'm gonna look into trying out some other games now.
Thanks for the JS code, modified it to shoot the transparent images off somewhere else so that hopefully someone makes an auto process for transparency soonOff the top of my head, I think the best way to work around the transparency problem and upscale those textures is this:
1) copy the transparency data into a new image of the same dimensions, but put the transparency in the R/G/B channel instead of A.
2) upscale the new image with an upscaler, maybe ESRGAN but I would probably choose something more predictable or better for simple graphics like bilinear or even maybe Waifu2x
3) Copy the new upscaled image's R/G/B values into the upscaled texture's A channel.
This will allow for upscaling of textures with transparency. I will probably try this out a little later.
.
I have a Node script I'm working on that does the same thing plus some additional work to filter out single color textures and ones dumped from FMVs. The only thing preventing me from releasing it right now is the fact that some of the textures in Metroid Prime still don't appear to play nice even after only processing textures with no alpha channel. If waifu2x-caffe does support transparency like Ninjatogo said, that should be good enough for most cases.Thanks for the JS code, modified it to shoot the transparent images off somewhere else so that hopefully someone makes an auto process for transparency soon
Thanks for the JS code, modified it to shoot the transparent images off somewhere else so that hopefully someone makes an auto process for transparency soon
Java:package pngTransparencyDetector; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileFilter; import java.io.IOException; import javax.imageio.ImageIO; public class TransparencyDetector { public static void main(String[] args) { //If you want to use this program on the command line //File workingDirectory = new File(System.getProperty("user.dir")); //if you just want to hardcode the directory... File workingDirectory = new File("D:\\dev\\machinelearning\\ESRGAN\\LR"); System.out.println("Working Directory: " +workingDirectory); copyAlphaToImages(workingDirectory); } /** * Copies the alpha channel from images and saves the channel as RGB in new "alpha images". */ public static void copyAlphaToImages(File workingDirectory) { //filter files File[] files = workingDirectory.listFiles(new FileFilter() { public boolean accept(File file) { return (!file.isDirectory() && file.getName().toLowerCase().endsWith(".png")); }}); for (int i = 0; i < files.length; i++) { System.out.println("Processing " + (i+1) + " of "+ files.length+" "+ files[i].getName()); String alphaFile = files[i].getAbsolutePath(); alphaFile = alphaFile.substring(0, alphaFile.length()-4) + ".a.png"; File outFile = new File(alphaFile); BufferedImage pngIn = null; BufferedImage pngOut = null; try { pngIn = ImageIO.read(files[i]); pngOut = new BufferedImage(pngIn.getWidth(), pngIn.getHeight(), pngIn.getType()); } catch (IOException e) { System.out.println("Failed to open file."); e.printStackTrace(); continue; } int alphaPixelCount = 0; for (int y = 0; y < pngIn.getHeight(); y++) { for (int x = 0; x < pngIn.getWidth(); x++) { int pixel = pngIn.getRGB(x, y); int a = (pixel & 0xFF000000) >>> 24; int r = (pixel & 0xFF0000) >>> 16; int g = (pixel & 0xFF00) >>> 8; int b = (pixel & 0xFF); pngOut.setRGB(x, y, (0xFF000000) | (a << 16) | (a << 8) | a); if (a != 255) { alphaPixelCount ++; } } } if (alphaPixelCount > 0) { System.out.println("Writing transparent pixels to "+outFile.getName()); try { ImageIO.write(pngOut, "png", outFile); } catch (IOException e) { System.out.println("Failed to create png file."); e.printStackTrace(); } } else { System.out.println("Image has no transparent pixels."); } } System.out.println("Finished!"); } }
Java:package pngTransparencyDetector; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileFilter; import java.io.IOException; import javax.imageio.ImageIO; public class TransparencyDetector { public static void main(String[] args) { //If you want to use this program on the command line //File workingDirectory = new File(System.getProperty("user.dir")); //if you just want to hardcode the directory... File workingDirectory = new File("D:\\dev\\machinelearning\\ESRGAN\\LR"); System.out.println("Working Directory: " +workingDirectory); restoreAlphaFromImages(workingDirectory, false); } /** * Restores image's alpha channel from an alpha image, optionally deleting the alpha image when complete. */ public static void restoreAlphaFromImages(File workingDirectory, boolean deleteAlphaFiles) { //filter files File[] files = workingDirectory.listFiles(new FileFilter() { public boolean accept(File file) { return (!file.isDirectory() && file.getName().toLowerCase().endsWith(".png") && !file.getName().toLowerCase().endsWith(".a.png")); }}); //the results will be dumped into a subfolder File outputDirectory = new File(workingDirectory.getAbsolutePath() + File.separator + "restored-alpha"); //a weird case I ran into if (outputDirectory.exists() && !outputDirectory.isDirectory()) { System.err.println("Delete the file called "+outputDirectory+" and try again."); return; } outputDirectory.mkdirs(); for (int i = 0; i < files.length; i++) { System.out.println("Processing " + (i+1) + " of "+ files.length+" "+ files[i].getName()); String alphaFilename = files[i].getAbsolutePath(); alphaFilename = alphaFilename.substring(0, alphaFilename.length()-4) + ".a.png"; File alphaFile = new File(alphaFilename); if (!alphaFile.exists()) { System.out.println("No alpha file exists for this .png"); continue; } File outFile = new File(outputDirectory + File.separator + files[i].getName()); BufferedImage pngIn = null; BufferedImage pngAlpha = null; BufferedImage pngOut = null; try { pngIn = ImageIO.read(files[i]); pngAlpha = ImageIO.read(alphaFile); pngOut = new BufferedImage(pngIn.getWidth(), pngIn.getHeight(), BufferedImage.TYPE_INT_ARGB); } catch (IOException e) { System.out.println("Failed to open file."); e.printStackTrace(); continue; } for (int y = 0; y < pngIn.getHeight(); y++) { for (int x = 0; x < pngIn.getWidth(); x++) { int pixel = pngIn.getRGB(x, y); int a = (pixel & 0xFF000000) >>> 24; int r = (pixel & 0xFF0000) >>> 16; int g = (pixel & 0xFF00) >>> 8; int b = (pixel & 0xFF); int alphaPixel = pngAlpha.getRGB(x, y); int aa = (alphaPixel & 0xFF000000) >>> 24; int ar = (alphaPixel & 0xFF0000) >>> 16; int ag = (alphaPixel & 0xFF00) >>> 8; int ab = (alphaPixel & 0xFF); //I average the value from all channels, but you can do whatever technique you want int finalAlpha = (ar + ag + ab) / 3; if (finalAlpha > 250) finalAlpha = 255; if (finalAlpha < 5) finalAlpha = 0; pngOut.setRGB(x, y, (finalAlpha << 24) | (r << 16) | (g << 8) | b); } } System.out.println("Writing restored image to "+outFile.getName()); try { ImageIO.write(pngOut, "png", outFile); } catch (IOException e) { System.out.println("Failed to create png file."); e.printStackTrace(); continue; } if (deleteAlphaFiles) { alphaFile.delete(); } } System.out.println("Finished!"); } }
I have a Node script I'm working on that does the same thing plus some additional work to filter out single color textures and ones dumped from FMVs. The only thing preventing me from releasing it right now is the fact that some of the textures in Metroid Prime still don't appear to play nice even after only processing textures with no alpha channel. If waifu2x-caffe does support transparency like Ninjatogo said, that should be good enough for most cases.
Okay, I did what I said above at the end of my post above to also upscale the transparent textures. Now every texture in these scenes should be upscaled.
Here's the results:
Orginal image:
https://i.imgur.com/fDTMlEx.png
New image:
Original image:
https://i.imgur.com/42QmnY9.png
New image:
And a third image that I didn't get a comparison shot for:
I think it looks pretty good. I actually upscaled the transparent textures and the transparencies themselves all with ESRGAN, and I'm a little surprised it turned out well. I'm gonna look into trying out some other games now.
I need to do another test run because it's possible i just fucked it up my first go around, but the main offenders are "particle" effects and some UI elements. You can spot the differences in the screenshot comparisons I posted earlier in the thread.I actually did that for my previous post but forgot to include the code!
The first step is to copy the transparency from each image to a new image, but copy to the RGB channel. Here's the code for that:
The next step is up upscale using your favorite upscaler. It may be a better idea to upscale the alpha images separately with a different algorithm (probably nearest neighbor, bilinear, or waifu2x), even though I didn't end up doing that myself.
The final step is to restore the transparency to each image by using the upscaled alpha images. Here is the code for that:
Hmm I wonder why it's not working with Metroid Prime... Which textures aren't playing nice?
Detecting single color textures is a great idea. Especially textures like text, certain HUD elements and whatnot should not be upscaled with this algorithm. They probably have at most 8 unique colors.
It only runs on still images. However, emulators with support for dumping and loading custom textures (as well as native PC games that have their textures in the correct format) can load the upscaled textures for gameplay (see my above post).Pardon me for asking here, but like...are we only able to run this program to play with still images, or is it like an emulator filter where it can be applied to a game running in real-time with you able to play with it running?
Nice! using this with Ishiiruka & SSAO, etc will be the closest thing to a remaster.Without further ado, I present to you: The Metroid Prime 1 Full Game HD Texture Pack for Dolphin! Installation instructions can be found here.
Download link: (1.80GB)
https://mega.nz/#!GUEhAaDC!knvXl6CAG14rwCqZ94A2XEEFBq12ih-nIinkQqzrhos
This is for the Gamecube version (GameID GM8E01), not Metroid Prime Trilogy. This retextures virtually the entire game. There's about 7000 textures upscaled with ESRGAN (manga109 model) and an additional 2000 upscaled with waifu2x-caffe (UpRGB model).
I'll try to record and upload a gameplay vid later today. In the meantime, I don't have a reddit account, so if someone could repost it to r/gameUpscale or whatever other subreddit is appropriate, I would appreciate. I'll also be upload my script to github along with instructions for how to do this with other games. I'm planning on trying Melee, Soul Calibur 2, and THPS3+4 next.
I'll link it around once that vid goes live :)Without further ado, I present to you: The Metroid Prime 1 Full Game HD Texture Pack for Dolphin! Installation instructions can be found here.
Download link: (1.80GB)
https://mega.nz/#!GUEhAaDC!knvXl6CAG14rwCqZ94A2XEEFBq12ih-nIinkQqzrhos
This is for the Gamecube version (GameID GM8E01), not Metroid Prime Trilogy. This retextures virtually the entire game. There's about 7000 textures upscaled with ESRGAN (manga109 model) and an additional 2000 upscaled with waifu2x-caffe (UpRGB model).
I'll try to record and upload a gameplay vid later today. In the meantime, I don't have a reddit account, so if someone could repost it to r/gameUpscale or whatever other subreddit is appropriate, I would appreciate. I'll also be upload my script to github along with instructions for how to do this with other games. I'm planning on trying Melee, Soul Calibur 2, and THPS3+4 next.
Yes, sadly. If you're only going for backgrounds in BK, you could download a 100% save file and just visit every screen. I think there might be some one off areas you can't go back to, but you could probably get most of them that way.The only way to get all the texture from a game un Dolphin is to play it yourself with dump texture enabled ?
I could see myself doing Baten Kaitos texture since I liked my first results, but if it mean doing all the game first... that's quite time consuming..
I need that video
Without further ado, I present to you: The Metroid Prime 1 Full Game HD Texture Pack for Dolphin! Installation instructions can be found here.
Download link: (1.80GB)
https://mega.nz/#!GUEhAaDC!knvXl6CAG14rwCqZ94A2XEEFBq12ih-nIinkQqzrhos
This is for the Gamecube version (GameID GM8E01), not Metroid Prime Trilogy. This retextures virtually the entire game. There's about 7000 textures upscaled with ESRGAN (manga109 model) and an additional 2000 upscaled with waifu2x-caffe (UpRGB model).
I'll try to record and upload a gameplay vid later today. In the meantime, I don't have a reddit account, so if someone could repost it to r/gameUpscale or whatever other subreddit is appropriate, I would appreciate. I'll also be upload my script to github along with instructions for how to do this with other games. I'm planning on trying Melee, Soul Calibur 2, and THPS3+4 next.
I guess I could start with that then maybe later take the oppotunity to play the game again. I mean I love the game but I have like 10 jrpg in my backlog who should take priority ^^"Yes, sadly. If you're only going for backgrounds in BK, you could download a 100% save file and just visit every screen. I think there might be some one off areas you can't go back to, but you could probably get most of them that way.
After some quick googling, this might be helpful:Could this pack work with the European version "GM8P01" of the game?
these are only gamecube/wii textures tho, i'd imagine the developers would have access to uncompressed original texturesMan I hope the developers doing the Metroid Prime Trilogy conversion at Nintendo are aware of this technology... it could very well be that this fan conversion will look miles better than the real thing! What about Silent Hill 2? That could work amazingly!