Register - Login
Views: 99798416
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 06:07:37 AM
Jul - SM64 Hacking (Archive) - PixelScrambler: A fortran program for automized texture modding New poll - New thread - Thread closed
Next newer thread | Next older thread
bonifarz
Member
Level: 16


Posts: 24/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-09-07 01:58:35 PM (last edited by bonifarz at 12-26-07 06:04 PM) Link
Overview

Pixelscrambler is a tool that allows you to tune the colors of an extended,
possibly modified ROM of SM64. It reads your tilemolester bookmarks
from an xml file, takes them as offset and ending of the textures you wish
to adjust and optionally tunes the Mario colors. An xml file with the
bookmarks of most textures is provided as well. The program does not
have a GUI, but it should be easy to use and ...fast.


download: http://www.mediafire.com/?4m3c4vjmndx


Example: Turning day into night.

We want to dim the colors, reduce the saturation and add some blue.
Because reducing the lightness of bright colors in HSL space yields
strong hue fluctuations, we also reduce red and green.


The input.txt for the above example.





The head and tail of terminal output (verbose on)


Load screen


Castle at night.


Lethal Lava Land.


Night flight.


The following passage is found in the README.txt


About the files:

The .exe file is a standalone application of the .f90 code created with
gfortran. I provide it for Windows users who do not want to compile
themselves. To run the program, it must be located in the same
directory as the input.txt, the bookmark file and the rom you wish to
read from (otherwise, include the path in the filenames).
If you place a copy of the bookmark file out.xml in your
tilemolester/resources directory and give it the appropriate name,
it will be loaded by tilemolester as well. The program will create two
files, the processed rom and an optional colorsample that can be
viewed with tilemolester.


Screenshot of tilemolester with the bookmarks from out.xml


About the input file:

Most input is commented.
The first three lines give the names of your files,
followed by one line of options and six lines defining
how to process the colors of your rom.


About the options:

The options line is read up to the first blank space or comma,
anything that follows is comment.
Recognized keywords are mario, verbose, sample, wait and swap.
Excluding mario conserves the mario colors.
Excluding verbose reduces terminal output.
With sample, a mapping of both, RGB and HSL space is written in a .z64 file.
The option wait is helpful if you run the .exe by double click
and you don't want to have the window closed on exit.
The option swap switches between big and little endian byte order.


About color transformations:

Consider each coordinate in color space normalized to the interval from 0 to 1.
Scaling factor and shift define a linear function: (color-0.5)*factor+0.5 + shift
Recommended are shifts in [-0.5 , 0.5] and factors of 1 (default).
All values except for hue are capped to the interval from 0 to 1.
Therefore, any scaling factor other than +/- 1 and any amount of shift will
cause a loss of color information. The hue value is not capped but has periodic
boundary conditions. This means you can shift the colors on the hue spectrum
without losing information.


About the colorsample:

With the option sample, a color sample is written, which contains
all possible input and output colors and can be viewed with tilemolester.
The four coloumns are mappings of RGB input and output,
followed by HSL input and output. Note that only that part of HSL space
is shown, which is sampled by your color settings.


A part of the colorsample of the above example.


About custom bookmarks:

If you wish to use your own bookmark file, make sure to have all offsets
arranged in pairs of both, a (group of) textures offset and ending.
The ending is the offset of the first tile NOT to process. If you don't want
to use an xml file from tilemolester, flag all decimal offsets by the patterns
offset=" and ".




____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Xkeeper

Level: 263


Posts: 3882/25353
EXP: 297139974
For next: 1820479

Since: 07-03-07

Pronouns: they/them/????????

Since last post: 3 days
Last activity: 20 min.

Posted on 12-09-07 02:08:06 PM Link
Some, uh, screenshots of what this does would be nice.

____________________

bonifarz
Member
Level: 16


Posts: 25/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-09-07 02:18:06 PM Link
Originally posted by Xkeeper
Some, uh, screenshots of what this does would be nice.


Thanks. I thought it would be clear. Tilemolestor Screenie for that job added.



____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Xkeeper

Level: 263


Posts: 3884/25353
EXP: 297139974
For next: 1820479

Since: 07-03-07

Pronouns: they/them/????????

Since last post: 3 days
Last activity: 20 min.

Posted on 12-09-07 02:36:07 PM Link
...

It looks like something you could do in Paint or Irfanview. Uh.

____________________

bonifarz
Member
Level: 16


Posts: 26/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-10-07 05:41:45 AM Link
Originally posted by Xkeeper
...

It looks like something you could do in Paint or Irfanview. Uh.



Uh... let me explain.
First of all, it does not process any picture format, but accesses the rom directly to overwrite the regions bit by bit. That would not be such a big deal if TT64 could export all the textures or tilemolester was a bit more flexible in exporting and importing.

Second, even if you could easily export the textures you wish to modify, you would have to process one after the other and import them all again. Here you can sweep over as many regions as you wish in one run, each possibly containing several textures.

Third, the software you mentioned seems to have very limited color adjusting capabilities. The example I gave was just to invert the colors, which is trivial, but you can adjust the strength and scale of the r g and b channel separately as well.

Fourth, if the program is useless indeed, that is no problem. I implemented it to learn something and decided to share my insights.




____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Ebeb

Level: 18


Posts: 31/54
EXP: 29115
For next: 782

Since: 08-06-07

From: NY

Since last post: 14.4 years
Last activity: 14.3 years

Posted on 12-10-07 10:01:20 AM (last edited by Ebeb at 12-10-07 03:34 PM) Link
This is a nice tool, though, bonifarz. Now I can invert colors without getting annoyed by Tile Molester. Much. (I really should come up with another SM64 texture idea, inverted colors is getting stupid and a bit old).
paulguy

Green Birdo
Level: 93


Posts: 15/2294
EXP: 8032337
For next: 20473

Since: 09-14-07

From: Buffalo, NY

Since last post: 9.7 years
Last activity: 9.7 years

Posted on 12-10-07 12:27:36 PM Link
Any tile editing programs without endian problems? I'd hate to make a hack with bleedy colors.
bonifarz
Member
Level: 16


Posts: 27/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-11-07 10:24:12 AM Link
Originally posted by paulguy
Any tile editing programs without endian problems?



True. As I learn about these issues, I included another option to switch between big and little endian byte order. I also found a couple of other problems that should be fixed now. I will post the update after some testing. It would be nice if I could also provide a full list of all texture offsets so you could process the color values of the entire rom in one run. But I think I am too lazy for that. On the other hand, this would allow a REAL i/o check that prevents you from scambling asm code



____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Mega Mario XD
80
Level: 22


Posts: 49/81
EXP: 53086
For next: 5264

Since: 10-26-07

From: Australia

Since last post: 13.8 years
Last activity: 13.8 years

Posted on 12-13-07 05:36:08 AM Link
What Matthew Coburn has to say on this topic...
****
The thing is, can the N64 still read the correct texture for the paintings? Eg. Willl the ROM display Bomb-omb Battle Field's painting correctly, or just display garabage?

____________________
Matthew Coburn
Member of the Peachy64 Hacking Team
World 9 - Hacking Forums
Sig Banner
****
THIS POST IS TOTALLY ORIGINAL
UNAUTHORISED DUPLICIATION PROHIBITED
bonifarz
Member
Level: 16


Posts: 28/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-13-07 01:49:36 PM (last edited by bonifarz at 12-15-07 04:52 AM) Link
Originally posted by Matthew Coburn
The thing is, can the N64 still read the correct texture for the paintings? Eg. Willl the ROM display Bomb-omb Battle Field's painting correctly, or just display garabage?


Here WAS an example of the inversion of the red color channel.

The next release will not overwrite parts of your ROM but create a new file.
It might be ready soon, or take its time for debugging. Let's see.

____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Xkeeper

Level: 263


Posts: 3917/25353
EXP: 297139974
For next: 1820479

Since: 07-03-07

Pronouns: they/them/????????

Since last post: 3 days
Last activity: 20 min.

Posted on 12-13-07 08:35:41 PM Link
...I, for one, would rather see actual talent instead of "hey, look, I can puke on the colors".

(Yeah, I don't like this. LOL INVERTED MARIO!!!111)

____________________

Apofisu

Level: 32


Posts: 56/193
EXP: 197349
For next: 9093

Since: 07-03-07


Since last post: 11.0 years
Last activity: 9.1 years

Posted on 12-13-07 09:47:52 PM Link
Wow! You've made a program that makes the graphics look like they were done by someone tripping on acid! Way to fail!
Mega Mario XD
80
Level: 22


Posts: 50/81
EXP: 53086
For next: 5264

Since: 10-26-07

From: Australia

Since last post: 13.8 years
Last activity: 13.8 years

Posted on 12-14-07 01:11:59 AM Link
What Matthew Coburn has to say on this topic...
****
Originally posted by Apophis
Wow! You've made a program that makes the graphics look like they were done by someone tripping on acid! Way to fail!


Hey! Bonifarz has done a wonderful job at making this tool, and you stab him with a "Way to fail" comment?

This program is great if you want to make a "night-time" hack or something. It's also good because you can then replace the painting with your own custom one, eg. a SM64 Beta-like Painting.

____________________
Matthew Coburn
Member of the Peachy64 Hacking Team
World 9 - Hacking Forums
Sig Banner
****
THIS POST IS TOTALLY ORIGINAL
UNAUTHORISED DUPLICIATION PROHIBITED
Apofisu

Level: 32


Posts: 58/193
EXP: 197349
For next: 9093

Since: 07-03-07


Since last post: 11.0 years
Last activity: 9.1 years

Posted on 12-14-07 01:23:23 AM Link
You're right. I was in a bad mood, and I apologize. While I may not see a practical application for this program, I have to admire anyone who can program in fortran.
bonifarz
Member
Level: 16


Posts: 29/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-14-07 07:17:05 AM Link
Originally posted by Matthew Coburn
Originally posted by Apophis
Wow! You've made a program that makes the graphics look like they were done by someone tripping on acid! Way to fail!


Hey! Bonifarz has done a wonderful job at making this tool, and you stab him with a "Way to fail" comment?

This program is great if you want to make a "night-time" hack or something. It's also good because you can then replace the painting with your own custom one, eg. a SM64 Beta-like Painting.



Heheh, this amuses me. Don't worry, I won't get you wrong and I won't feel offended.

The new program works perfectly now and converts the ENTIRE ROM in about 0.25 seconds on a laptop with 1.7 GHz per core!

Ahmmm, it's not about hacking painting textures, it processes ALL TEXTURES YOU WANT in one run. Am I getting repetitive?

Linear transformations in RGB space work fine, but I will also impement linear transformations in HSL space before I release the program.

And if you want to learn about fortran, just PM me, its the main tool of my masters thesis.





____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Deleted User
Collection of nobodies
Posted on 12-14-07 03:55:12 PM Link
If I want to learn about Fortran, I just read Wikipedia and go from there.

Actually, I'm more surprised at the fact people still use it!

*Kawa slinks back never to post here again

____________________


===================
[Posted by Kawa]
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 192


Posts: 889/12211
EXP: 99320771
For next: 552800

Since: 07-03-07

From: 52-2-88-7

Since last post: 7.4 years
Last activity: 7.3 years

Posted on 12-15-07 07:30:23 AM Link
12-15-07 01:30:23am
889 posts
164 days
I don't know why I put this here.
I should make a COBOL program which scrambles the colors of random Mario images. That would be very useful! Not.

I see what you're doing here, but I think you may want to try to make it more complex. Like... maybe do a pallete swap or something that'll result in an image that DOESN'T look like somebody left it out in the sun and then spilled rainbow goo on it. Just a suggestion.

____________________
"My name is Ozymandias, king of kings: Look on my works, ye mighty, and despair!" Nothing beside remains: round the decay Of that colossal wreck, boundless and bare, The lone and level sands stretch far away. -ShelleyDeath to n00bs!
bonifarz
Member
Level: 16


Posts: 31/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-15-07 07:51:21 AM (last edited by bonifarz at 12-15-07 04:56 AM) Link
Originally posted by Metal_Man88
I should make a COBOL program which scrambles the colors of random Mario images. That would be very useful! Not.

I see what you're doing here, but I think you may want to try to make it more complex. Like... maybe do a pallete swap or something that'll result in an image that DOESN'T look like somebody left it out in the sun and then spilled rainbow goo on it. Just a suggestion.



I see it was a mistake to post that old version of the program before my project was finished. Sorry for that. The example I put above was a check for correct behavior of the application and I know that it looks HORRIBLE, so I removed it.
If I have the time, I will finish the code such that it allows you to tune the red, green, blue, hue, saturation and lightness of all textures, just as you are used to tune your pictures with some standard viewer software or open office.

Swapping the palette would be trivial, but here we have 16bbp rgba, a type of rich color format. On the other hand, in the current version I actually create a "palatte" of 2*32^3 possible colors to process the rom's data much faster (and with a better scaling).

Please be patient, there will something to judge soon, but it's not finished up to now.



____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Mega Mario XD
80
Level: 22


Posts: 54/81
EXP: 53086
For next: 5264

Since: 10-26-07

From: Australia

Since last post: 13.8 years
Last activity: 13.8 years

Posted on 12-17-07 11:37:39 PM (last edited by Matthew Coburn at 12-17-07 08:49 PM) Link
What Matthew Coburn has to say on this topic...
****
Bonifarz, you have a great tool. I must add it to my hacking collection.

And I was thinking of a "midnight sleepwalk" concept for a SM64 Hack, with your new screenshot. Heh. '

____________________
Matthew Coburn
Member of the Peachy64 Hacking Team
World 9 - Hacking Forums
Sig Banner
****
THIS POST IS TOTALLY ORIGINAL
UNAUTHORISED DUPLICIATION PROHIBITED
bonifarz
Member
Level: 16


Posts: 32/41
EXP: 19128
For next: 1128

Since: 10-20-07

From: Switzerland

Since last post: 14.1 years
Last activity: 14.0 years

Posted on 12-18-07 02:43:39 PM (last edited by bonifarz at 12-26-07 06:11 PM) Link
Some things have been rearranged in the input file, some minor issue has been fixed and the colorsample.z64 has been extended to 4x16x32 tiles including a partial mapping of HSL space. All together gives Version 0.3, as linked in the threads header.

Any constructive feedback is highly appreciated.



EDIT:

Version 0.4 is linked and documented at the top of this thread.
It supports tilemolesters bookmark format and optionally tunes the Mario colors.



____________________
Greetings,
Bonifarz
______________________
visit nccr nano sciences
Next newer thread | Next older thread
Jul - SM64 Hacking (Archive) - PixelScrambler: A fortran program for automized texture modding New poll - New thread - Thread closed


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

31 database queries, 8 query cache hits.
Query execution time: 0.111899 seconds
Script execution time: 0.033407 seconds
Total render time: 0.145306 seconds