Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
74a694a
Some AI generated texture. Not best quality, but better that nothing
Spliterash Sep 1, 2021
bb172aa
Another textures
Spliterash Sep 2, 2021
d726bad
Another AI textures
Spliterash Sep 2, 2021
ffe66bf
And another textures
Spliterash Sep 2, 2021
5c71347
Add Mochihi textures
Spliterash Sep 2, 2021
70e7803
Regenerate UI texture
Spliterash Sep 2, 2021
9e368ff
Added scripts and some new textures
Spliterash Sep 3, 2021
b5f518c
Update README.md
Spliterash Sep 3, 2021
84b4add
Some textures
Spliterash Sep 3, 2021
f76b50b
Added flame mochihi and something else
Spliterash Sep 3, 2021
d43497f
More cool mochihi
Spliterash Sep 3, 2021
df3aa87
Desert textures
Spliterash Sep 3, 2021
befe50a
Some desert stuff
Spliterash Sep 3, 2021
35e04f4
Новая партия текстур
Spliterash Sep 4, 2021
346a861
Update some UI textures
Spliterash Sep 4, 2021
da020d1
Add cooking minigame
Spliterash Sep 4, 2021
bf0f936
New textures yay
Spliterash Sep 4, 2021
e6270e1
Demon boss
Spliterash Sep 4, 2021
626798e
Another textures
Spliterash Sep 4, 2021
c8343d2
Textures))))))
Spliterash Sep 4, 2021
ea50c98
Текстуры крабика
Spliterash Sep 4, 2021
7d26485
Rename folder
Spliterash Sep 5, 2021
e4a88a8
New textures and new scripts
Spliterash Sep 5, 2021
72596bb
New textures
Spliterash Sep 5, 2021
143ab58
Final loc textures + scirpt fix
Spliterash Sep 5, 2021
b8e474c
Add final boss textures
Spliterash Sep 5, 2021
ddd20c9
Final final cutscene
Spliterash Sep 5, 2021
0e422d0
Remove scripts zip
Spliterash Sep 7, 2021
1010828
Upscale textures from game start
Spliterash Sep 17, 2021
fbfd1eb
Update README.md
Spliterash Sep 17, 2021
0615254
random textures
Spliterash Oct 2, 2021
070d4b3
Merge remote-tracking branch 'original/master' into ai
Spliterash Jun 28, 2022
0307eeb
Merge remote-tracking branch 'original/master' into ai
Spliterash Jan 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
new
.idea
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
TEMP/
*.pth

input
output
add
52 changes: 10 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,25 @@
<img width=420px height=150px src="https://upload.wikimedia.org/wikipedia/commons/a/af/Patapon_2_logo.png" alt="Patapon 2 logo"></a>
</p>

<h3 align="center">Patapon 2 HD</h3>
<h3 align="center">Patapon 2 HD AI</h3>

<div align="center">

[![Contributors](https://img.shields.io/github/contributors/shockturtle/Patapon2HD)](https://github.com/shockturtle/Patapon2HD/graphs/contributors)
[![Stargazers](https://img.shields.io/github/stars/shockturtle/Patapon2HD)](https://github.com/shockturtle/Patapon2HD/stargazers)
[![Issues](https://img.shields.io/github/issues/shockturtle/Patapon2HD.svg)](https://github.com/shockturtle/Patapon2HD/issues)
[![Pull Requests](https://img.shields.io/github/issues-pr/shockturtle/Patapon2HD.svg)](https://github.com/shockturtle/Patapon2HD/pulls)

</div>

---

Side Project for HD Patapon 2 textures.

All textures are done entirely by me unless comments in textures.ini state otherwise.

## 🎈 Usage <a name="usage"></a>

To install, enable Texture Replacement in PPSSPP dev menu (Settings->Tools->Developer Tools).

Put both the textures folder and textures.ini files in `PPSSPP/memstick/PSP/TEXTURES/%GAME_ID%`

If the textures folder doesnt exist, make it.

| Region | Game ID |
| ------: | ----------- |
| EU | `UCES01177` |
| NA | `UCUS98732` |
| JP | `UCJS10089` |
| AS | `UCAS40239` |


## 🎉 Acknowledgements <a name = "acknowledgement"></a>
BIG Thank you to

- [owocek](https://github.com/owocekTV) (Motivation)

- Xandis/Gat235 (Every single bird and javelin)

- Iracy (Materials and other items)

- [RinCasi](https://twitter.com/I26mc) (Various symbols and high-quality resources)

- [efonte](https://github.com/efonte) (AI Upscaling)


Special Thanks to

- [WallSoGB](https://github.com/WallSoGB) (Leader of the [Patapon3Textures](https://github.com/WallSoGB/Patapon3Textures) project)
AI upscaled Patapon 2 textures.

Contains all exists textures from [Patapon 2 HD](https://github.com/shockturtle/Patapon2HD) repository

If you want generate missing textures, it very easy.

1) Enable saving new nextures in PPSSPP dev settings
2) Copy all yours textures from `new` to `ai_upscale_workdir/input`
3) Press `ai_upscale_workdir/generate_ai_textures.bat` and select models
* `1_4x_FatalPixels_340000_G_4x_Fatality_01_265000_G_interp_05` works very good, but sometimes `1_4x_Loyaldk-SuperPony_500000_V2.0` work better
4) After upscale finish first press `copy.bat`, after `paste.bat`

And it's done, you generated new textures
42 changes: 42 additions & 0 deletions ai_upscale_workdir/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Fork of [BlueAmulet's fork](https://github.com/BlueAmulet/ESRGAN) of [ESRGAN by Xinntao](https://github.com/xinntao/ESRGAN)

This fork ports features over from my ESRGAN-Bot repository and adds a few more. It natively allows:

* In-memory splitting/merging functionality (fully seamless, recently revamped for the third time and no longer requires tile size)
* Seamless texture preservation (both tiled and mirrored)
* Model chaining
* Transparency preservation (3 different modes)
* 1-bit transparency support (with half transparency as well)
* Both new-arch and old-arch models
* Regular and SPSR models, of any scale or internal model settings
* On-the-fly interpolation

**Tile size was recently removed! It is no longer needed for split/merge functionality!**

To set your textures to seamless, use the `--seamless` flag. For regular tiled seamless mode, use `--seamless tile`. For mirrored seamless mode, use `--seamless mirror`. You can also add pixel-replication padding using `--seamless replicate` and alpha padding using `--seamless alpha_pad`.

To chain models, simply put one model name after another with a `>` in between (you can also use `+` if using bash to avoid issues), such as `1xDeJpeg.pth>4xESRGAN.pth` **note: To use model chaining, model names must be the complete full name without the path included, and the models must be present in your `/models` folder. You can still use full model paths to upscale with a single model.**

For on-the-fly interpolation, you use this syntax: `<model1_name>:<##>&<model2_name>:<##>`, where the model name is the path to the model and ## is the numerical percentage to interpolate by. For example, `model1:50&model2:50` would interpolate model1 and model2 by 50 each. The numbers should add up to 100. If you have trouble using `:` or `&`, either try putting the interpolation string in quotes or use `@` or `|` respectively (`"model1@50|model2@50"`).

To use 1 bit binary alpha transparency, set the `--binary-alpha` flag to True. When using `--binary-alpha` transparency, provide the optional `--alpha-threshold` to specify the alpha transparency threshold. 1 bit binary transparency is useful when upscaling images that require that the end result has 1 bit transparency, e.g. PSX games. If you want to include half transparency, use `--ternary-alpha` instead, which allows you to set the `--alpha-boundary-offset` threshold.

The default alpha mode is now 0 (ignore alpha). There are also now 3 other modes to choose from:

* `--alpha-mode 1`: Fills the alpha channel with both white and black and extracts the difference from each result.
* `--alpha-mode 2`: Upscales the alpha channel by itself, as a fake 3 channel image (The IEU way) then combines with result.
* `--alpha-mode 3`: Shifts the channels so that it upscales the alpha channel along with other regular channels then combines with result.

To process images in reverse order, use `--reverse`. If needed, you can also skip existing files by using `--skip-existing`.

If you're upscaling images of the same size, you can do `--cache-max-split-depth` to only calculate the automatic tile size once to improve performance.

Examples:

* `python upscale.py 4xBox.pth --seamless tile`
* `python upscale.py 1xSSAntiAlias9x.pth>4xBox.pth`
* `python upscale.py 4xBox.pth --binary-alpha --alpha-threshold .2`
* `python upscale.py /models/4xBox.pth`
* `python upscale.py "1x_model1.pth@50|1x_model2.pth@50>2x_model3.pth"`

If you want a GUI for ESRGAN and if you're on Windows, check out [Cupscale](https://github.com/n00mkrad/cupscale/). It implements most of this fork's features as well as other utilities around it.
2 changes: 2 additions & 0 deletions ai_upscale_workdir/generate_ai_textures.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
py generate_ai_textures.py
PAUSE
73 changes: 73 additions & 0 deletions ai_upscale_workdir/generate_ai_textures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import os
import shutil
from pathlib import Path

import upscale

processAlpha = None

inputVal=input("Need process alpha channel ? (Y,n)")
if inputVal.lower() == "n":
processAlpha = False
elif inputVal.lower() == "y" or not inputVal:
processAlpha = True
else:
print("Error input")
exit(0)

print("Select upscale engine, or if you want use multiple, write multiple numbers like 123")

models = os.listdir("models")

if len(models) == 0:
print("Download models and place in it models before use")
exit(0)

for i in range(len(models)):
print(str(i + 1) + ". " + models[i])

select = input("Select: ")
if not select.isdigit():
print("Write digit")
exit(0)

selectedModels = []

for i in select:
num = int(i) - 1
if num < 0 or num >= len(models):
print("Number bigger of models size or lower 0")
exit(0)
else:
selectedModels.append(models[num])

print("Start: " + " -> ".join(selectedModels))


def deleteFolder(path: str):
if os.path.exists(path):
shutil.rmtree(path)


tempFolder = "TEMP"
finalOutputFolder = "output"

deleteFolder(tempFolder)

inputFolder = "input"

for i in range(len(selectedModels)):
model = selectedModels[i]
modelResultFolder = "TEMP" + os.sep + str(i + 1) + "(" + model[0:20] + ")"

upscale.Upscale(
model=model,
input=Path(inputFolder),
output=Path(modelResultFolder),
alpha_mode=upscale.AlphaOptions.alpha_separately if processAlpha else upscale.AlphaOptions.no_alpha
).run()

inputFolder = modelResultFolder

deleteFolder(finalOutputFolder)
shutil.copytree(inputFolder, finalOutputFolder)
7 changes: 7 additions & 0 deletions ai_upscale_workdir/models/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Im use next models, you can find it in the internet:
* [4x_FatalPixels_340000_G](https://de-next.owncube.com/index.php/s/gPjswdm6gCegQdz)
* [4x_Loyaldk-SuperPony_500000_V2.0](https://mega.nz/file/IBhElRYJ#C_lVc8Vr2q8X6hEltJKD6I63U7oL_FDLeJgPh72AZmg)
* [1x_NoiseTonerV1_110000_G](https://drive.google.com/drive/u/0/folders/12j6BvuR7SU48ui9DHjBPB1vzPpQri9bD)
* [1x_Fatality_DeBlur_270000_G](https://de-next.owncube.com/index.php/s/aAojXwLTPZto8rP)

Very cool works Pony model, but some time combine fatalpixel->deblur->noiseToner give also very cool results
5 changes: 5 additions & 0 deletions ai_upscale_workdir/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
opencv_python
numpy
torch
rich
typer
Loading