marco-calautti / Rainbow

A texture format converter for different consoles' graphics formats.
GNU General Public License v2.0
81 stars 8 forks source link

Save Palettes as .cl2 #13

Closed WerhnerHeisenberg closed 5 years ago

WerhnerHeisenberg commented 5 years ago

I would to ask if you can make the program save the pallets as .cl2?. Sorry for posting a request here.

marco-calautti commented 5 years ago

Actually, I do not even know what a .cl2 file looks like. What is that?

WerhnerHeisenberg commented 5 years ago

Inside this 7zip file will found the .tm2 image and the pallet in cl2 format!.

marco-calautti commented 5 years ago

If you just want to apply the palette to the grayscale image, you can use ImageMagick's convert command.

convert gray_image.png palette.png -clut output_colored_image.png

marco-calautti commented 5 years ago

Which 7zip file?

WerhnerHeisenberg commented 5 years ago

Sorry, the GitHub seems not to uploaded the file. Here: https://mega.nz/#!jpczGIzT!_85J5t3-Q01AKixlusISDuMqeYBFAFTsod-4yl_nq0E

marco-calautti commented 5 years ago

As I said, you can easily apply the palette to the grayscale image via the command line, and using the convert command of ImageMagick:

convert gray_image.png palette.png -clut output_colored_image.png

marco-calautti commented 5 years ago

If you want to keep the transparency of the palette, then you can use the command:

convert -alpha Off image_grayscale.png -channel RGBA palette.png -clut image_colored.png

This is the result with your tm2 file: out.png

marco-calautti commented 5 years ago

If you want to remove the alpha, but you don't want to make fully transparent colors show, after you apply the palette, you can run the command: convert image_colored_with_alpha.png -channel Alpha -evaluate Multiply 2 output.png

you can replace the "2" with whatever amount you want to make the image less transparent. If you use 256, it will make every color, apart from the ones with full transparency, to appear as solid.

As you can see, you do not need any .cI2 file to work with multipalette images.

out-no-alpha.png

WerhnerHeisenberg commented 5 years ago

Thanks!

WerhnerHeisenberg commented 5 years ago

Did you know if is possible to edit this images with new colors?.

marco-calautti commented 5 years ago

You just have to do the reverse. Modify the colored image, and extract the palette with imagemagick.

You can find a lot of tutorials for that online.

Il lun 11 mar 2019, 21:58 RaidenRipper notifications@github.com ha scritto:

Did you know if is possible to edit this images with new colors?.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/marco-calautti/Rainbow/issues/13#issuecomment-471753143, or mute the thread https://github.com/notifications/unsubscribe-auth/AHrUTVOTKqYSktf4bKJNuyon3PZYZ2r3ks5vVtGhgaJpZM4bphJi .

WerhnerHeisenberg commented 5 years ago

Can you tell me white my images are all resulting in a background black and not like yours?.

marco-calautti commented 5 years ago

You have to keep the transparency of the palette, when applying it to the grayscale image: convert -alpha Off image_grayscale.png -channel RGBA palette.png -clut image_colored.png