ROM Hack Is it Possible to Import Textures into .bch Files Without Significant Quality Loss? (FE: Fates)

HelpTheWretched

Well-Known Member
Member
Joined
Feb 4, 2010
Messages
315
Trophies
1
XP
1,560
Country
Canada
Oh well, sadly not what I was looking for.
Darn. I'll try taking a look at .mm files to look for some similarities with the texture storage...

FYI, the first sentence you quoted ("It'll get compressed more than you'll like, but that's okay.") was referring to the dummying phase, where you're only changing the texture to see where in the file it's located.
 

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
Darn. I'll try taking a look at .mm files to look for some similarities with the texture storage...

FYI, the first sentence you quoted ("It'll get compressed more than you'll like, but that's okay.") was referring to the dummying phase, where you're only changing the texture to see where in the file it's located.

Well thanks for at least checking stuff out for me and gotcha. I assume you read my earlier post about .mm and .at, how I'm doing OR/AS stuff and all.
 

Shiro-san

Member
Newcomer
Joined
Jan 28, 2017
Messages
15
Trophies
0
Age
26
Location
Tellius
Website
www.twitter.com
XP
76
Country
United States
I have a guide that makes the images high quality. You'll need to download the Sprite Editting.zip I have attached to this.
First step, take the png you have and lower the opacity to 95%. All sprites have this slight transparency to make it seem less jarring from the background.

hnPbZ32.png


After you save it as a png, you need to also save it as tmp.tga. I don’t mess with RLE compression, so just press ok or whatever.

6pqUyH6.png


Take the tga and drag it over “tga_to_ctex.bat”. You should now have tmp.tga and tmp.ctex.

Take the ctex file and drag it over “ctex_to_bch_portraits.bat.” You’ll now have tmp.tga, tmp.ctex, and tmp.bch. You can choose to rename the bch to the corresponding facial expression name. In this case, I’m renaming it to “通常.bch”

GqCf3uI.png


Now, open the batchlz folder and load up BatchLZ77. The program should be set to LZ77 type 11 in options, if it’s not already.

Take the .bch file and drag it over the compress box. After a few moments, a .bch.lz file should appear.

Grab the .bch.lz file and put it into a hex editing program, like HxD. Replicate the first 4 bytes and change the first 11 to 13. If the first number is not 11, you messed up the LZ compression.
2ho8KKM.png


xmPT1Ih.png


Repeat this process for all of the other facial expressions. You don’t have to do this for blush and sweat, labeled as 照 and 汗, and instead can reuse the original files if you have them.

You can now move onto arc compression.

Once you have all of the facial expressions, it’s time to put them into a folder. You have to name it something in English, since the arc compressor doesn’t seem to work if the folder is named in Japanese.

pjDkJIe.png


Once you have this folder, drag it over “create.bat.” You’ll now have an arc file named after the folder! Rename the arc file to the charactername_portraittype (portrait types are: st- conversation portraits, bu- status window portraits, ct- critical portraits.) For mine, I’m naming it アンナ_st.arc.

Now throw it in the /face/face folder. It should be as high quality as you first put it in.
09MLU5I.png
 

Attachments

  • Sprite Editting.zip
    1.2 MB · Views: 298

IcySon55

Leader of Fan Translators International
Member
Joined
Mar 18, 2008
Messages
463
Trophies
1
Age
38
XP
2,261
Country
Canada
As noted by @DarkSynopsis, Kukkii is capable of opening and saving BCH files and can also maintain a high level of quality when saving.

We have our own custom ETC1 encoder which provides high quality results.
 

IcySon55

Leader of Fan Translators International
Member
Joined
Mar 18, 2008
Messages
463
Trophies
1
Age
38
XP
2,261
Country
Canada
Completely preventing artifacts where and when there should be none?
I'd recommend you take it for a test drive, we also recently just corrected a bug in handling the BCH format so please use the latest beta version: http://sx.sytes.net/kuriimu/releases/kuriimu-v1.0.11-0ea81b7-beta.rar

Our betas are a new thing I'm doing and are found on the #news channel of the Fan Translators Inc. Discord.

Note: Like it says in the OP of the program, don't forget to unblock the .rar before extracting it so that everything works properly.
 
Last edited by IcySon55,
  • Like
Reactions: Thelostrune

onepiecefreak

Kuriimu 2 Developer
Member
Joined
Aug 12, 2015
Messages
526
Trophies
0
XP
1,739
Country
Germany
I can confirm that this encoder works at least better than in Ohana and Rebirth.
It always worked with high quality in our the image formats.

Try it and see the results for yourself.
 

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,495
Country
France
I'd recommend you take it for a test drive, we also recently just corrected a bug in handling the BCH format so please use the latest beta version: http://sx.sytes.net/kuriimu/releases/kuriimu-v1.0.11-0ea81b7-beta.rar

Our betas are a new thing I'm doing and are found on the #news channel of the Fan Translators Inc. Discord.

Note: Like it says in the OP of the program, don't forget to unblock the .rar before extracting it so that everything works properly.
Still have a big compression lose when importing (PNG is edited with Photoshop 2018, NOT Paint) :/
 
  • Like
Reactions: Thelostrune

IcySon55

Leader of Fan Translators International
Member
Joined
Mar 18, 2008
Messages
463
Trophies
1
Age
38
XP
2,261
Country
Canada
Still have a big compression lose when importing (PNG is edited with Photoshop 2018, NOT Paint) :/
NeoBeo says: "ETC1 is known to be terrible at sharp gradients"

Basically, if your image has sharp edges, ETC1 is probably not the encoding you want. For that particular image, RGBA4444 would likely work better. Your encoding has to be suited to the image. ETC1 is normally used for textures and rarely used for images with hard edges.

Basically, if you're expecting ETC1 to handle that text image well, then you're out of luck. The encoding itself is simply incapable of compressing it well and it has nothing to do with the encoder.

Based on our own tests, our ETC1 encoder is the best one. It re-encodes ETC1 images with translation changes very well barely losing any fidelity. The absolute best encoder is the one written by Nintendo, however at maximum quality, their encoder can take hours on a 512x512 texture to encode. (Estimated based on Neo's calculations. He's a mathematician soon to hold a PhD.)
 
Last edited by IcySon55,

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
the text above
I'm going to test exporting then importing the same texture on a model real soon. That went just as well as in the picture above when it came to Ohana.
If it's the best as you say and it still doesn't provide the quality I seek, I'm going to have to ask for an editor in the program. Unlikely to be a thing, but if it's importing that's the issue, I have no other idea of a solution.
 
Last edited by Thelostrune,

onepiecefreak

Kuriimu 2 Developer
Member
Joined
Aug 12, 2015
Messages
526
Trophies
0
XP
1,739
Country
Germany
You're welcome to join and discuss every issue you have on our discord or create an issue on our github so we can fix every problem you have. If it's theoretically possible to solve it. We have many compressions and image encodings usable in our tool already and strive to make them of course better if needed or possible.
 
Last edited by onepiecefreak,

IcySon55

Leader of Fan Translators International
Member
Joined
Mar 18, 2008
Messages
463
Trophies
1
Age
38
XP
2,261
Country
Canada
I'm going to test exporting then importing the same texture on a model real soon. That went just as well as in the picture above when it came to Ohana.
If it's the best as you say and it still doesn't provide the quality I seek, I'm going to have to ask for an editor in the program. Unlikely to be a thing, but if it's importing that's the issue, I have no other idea of a solution.
Like I mentioned to Asia81, ETC1 is best used for textures with smoother gradients of color. Images that are already ETC1 encoded where you make some edits to the image will usually do just fine in our encoder. By its nature ETC1 is very lossy so your mileage may vary depending on the contents of the image. As discussed, try using Kukkii and lets us know how it goes.

Edit: There is no difference between importing a PNG and having the ability to edit the image in the program. In both cases the image data passed to the encoder is the same.
 
Last edited by IcySon55,
  • Like
Reactions: Thelostrune

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
As discussed, try using Kukkii and lets us know how it goes.

Seems to work perfectly fine for .MM models by decompressing with pk3DS. Thank you. Previously, I would see quality loss on levels with OP or file size changes as with Ohana Rebirth.

118d099d4b.jpg
 

IcySon55

Leader of Fan Translators International
Member
Joined
Mar 18, 2008
Messages
463
Trophies
1
Age
38
XP
2,261
Country
Canada
Seems to work perfectly fine for .MM models by decompressing with pk3DS. Thank you. Previously, I would see quality loss on levels with OP or file size changes as with Ohana Rebirth.
Beautiful! What did you change exactly? I don't see a difference other than the colors. Oh I see, it's just an export to PNG and re-import the same image like you mentioned?
 
Last edited by IcySon55,

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
Oh I see, it's just an export to PNG and re-import the same image like you mentioned?
Yes. Old Ohana compressed it no matter what and Rebirth removed the compression altogether after I complained about the compression mistakingly which made the file size go up and resulting in freezes.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://m.youtube.com/watch?v=FzVN9kIUNxw +1