[ X ]
[OpenRa.Utility] Converting Graphics for RA/CnC
Small chat with Chris about how to use the utility
Post new topic   Reply to topic Page 1 of 1
View previous topic :: View next topic  
Author Message
wusche1
Level: 35


Position: Registered User
Joined: 10 Jan 2012
Posts: 58
Kel: 70  [ Donate ]

Online Status: Offline
PostPosted: Wed Feb 08, 2012 9:09 pm    Post subject: [OpenRa.Utility] Converting Graphics for RA/CnC Reply with quote

Hi, since editing, extracting, creating etc graphics for Openra is a quite confusing affair, I decided to put down some information to help others in that endavour.



Step by step mini guide on how to use Openra.Utilities on the example of a cameo:

1.) Get the palette of the game, e.g. RA: OpenRa.Utility --extract ra temperat.pal

2.) Get a PNG file with the right palette settings by extracting it from a in-game ship file using the extracted palette setting: e.g. OpenRa.Utility --png ttnkicon.shp temperat.pal, with ttnkicon.shp beeing the cameo for the tesla tank.

3.) Use Photoshop (or any other program that uses the palette formats) to open the newly created ttnkicon.png and save the color table of the picture. This file has been attached as an attachment to this post.

4.) Use Photoshop (or any other program that uses the palette formats) to convert Your png format to 8bit/channel, using the custom palette saved before.

5.) Convert the PNG to SHP using OpenRa.Utility --shp YourPNGfile.png 64 , with 64 beeing the width of the cameo file.




Links of interest:

-- SHP Tools
-- shp -> png -> shp using OpenRA.Utility
-- SHP Tools
-- OPen source SHP Builder
-- OS SHP Builder 3.36 released!
-- Tileset Builder 2
-- Empty (no text) Red Alert and CnC Cameo recources









The full exempt of the chat with Chris on how to convert png to shp with the Openra utilities:



Code:
[21:44] <wuschel> Received args: --shp ghostrecon.png 64
[21:44] <wuschel> results in
[21:44] <wuschel>  System.IO.InvalidDataException: Unknown pixelformat
[21:44] <wuschel> with the Utilities.
[21:44] <wuschel> png is 64*48
[21:44] <+chrisf> it needs to be 8bit, and using the correct palette already.
[21:44] <wuschel> Ok.
[21:44] <wuschel> I see.
[21:45] <wuschel> RGB 8bit/channel it is.
[21:45] <+chrisf> if you're using ps, that's `indexed color mode`, and obtain a ps-format RA palette by running --png on some shp
[21:50] <wuschel> Actually 8bit/channel did the trick.
[21:50] <wuschel> I need to check it now.
[21:53] <+chrisf> you're going to be disappointed.
[21:53] == Thor_Away has changed nick to Thorpheus
[21:54] <+chrisf> we don't do any conversion from rgb -> indexed in the utility.
[21:54] <+chrisf> (that's actually an ugly problem, and ps does a better job than we can)
[21:54] <wuschel> Yes. I was.
[21:54] <wuschel> :/
[21:55] <+chrisf> are you using ps?
[21:55] <wuschel> Yes.
[21:55] <+chrisf> ok, there's 2 things you need to do:
[21:55] <wuschel> Now I have a "LSD Infantry" unit.
[21:55] <+chrisf> - obtain the ra palette.
[21:56] <+chrisf> use --png on some existing SHP; open the png in ps; save the color table
[21:56] <+chrisf> the second part is to use that color table:
[21:56] <+chrisf> - open your png; image->mode->indexed; load the color table you saved before
[21:57] <wuschel> I see. However, the png command requires a palette as well.
[21:57] <wuschel> --> --png SHPFILE PALETTE [--transparent] Convert a SHP to a PNG containing all of its frames, optionally setting up transparency
[21:57] <wuschel> and --png someshpfile does not owrk.
[21:57] <wuschel> work.
[21:57] <+chrisf> wuschel: do --extract ra temperat.pal
[21:58] <wuschel> ok
[21:58] <+chrisf> then --png someshpfile temperat.pal
[21:59] <+chrisf> that produces an indexed color png, with the correct palette embedded
[21:59] <+chrisf> the silly indirect method of obtaining the palette is needed because ps can't read westwood .pal
[22:00] <wuschel> I see.
[22:00] <wuschel> Will put that on the wiki
[22:02] <+chrisf> (and i dont want to write a .pal -> .act conversion just for ps's benefit)
[22:03] <+chrisf> the other thing i'll mention is that most unit authors use a custom palette with a magenta remap range
[22:03] <+chrisf> you can find a copy of that on the forum
[22:03] <+chrisf> (it helps the rgb -> indexed conversion to not confuse remap with other yellowish bits)


Attachment:

ttnkicon.png

 Filename:  ttnkicon.png
 Description:  TTNKicon with the RA palette, as requested by Petrenko. Note that I did not find the beforementioned magenta/yellow color palette on the forums yet (read chat log in post above).
2.83 KB :: Viewed 656 Time(s) :: [ Download ]

Attachment:
 Filename:  color_table_RA.zip
 Description:  Extracted color table to load with Photoshop. Note that there might be another color table on the forums with the beforementioned correction. This was used for successful conversions in the 2011-1223 playtest.
789 Bytes :: Downloaded 84 Time(s) :: [ Download ]



Last edited by wusche1 on Sat Feb 11, 2012 11:24 am; edited 5 times in total
Back to top
View user's profile Find all posts by wusche1 Send private message ICQ Number
BaronOfStuff
Level: 48


Position: Registered User
Joined: 22 May 2011
Posts: 312
Kel: 332  [ Donate ]

Online Status: Offline
PostPosted: Wed Feb 08, 2012 9:40 pm  Reply with quote

I must be missing something, this only explains how to extract SHP files as PNG's? Razz
Back to top
View user's profile Find all posts by BaronOfStuff Send private message ICQ Number
Petrenko
Level: 45



Position: Registered User
Joined: 08 Apr 2011
Posts: 125
Kel: 18  [ Donate ]

Online Status: Offline
PostPosted: Wed Feb 08, 2012 9:44 pm  Reply with quote

Can i get a indexed .png please?
_________________
Hail to the soviets!
Back to top
View user's profile Find all posts by Petrenko Send private message Send e-mail ICQ Number
wusche1
Level: 35


Position: Registered User
Joined: 10 Jan 2012
Posts: 58
Kel: 70  [ Donate ]

Online Status: Offline
PostPosted: Wed Feb 08, 2012 10:40 pm  Reply with quote

BaronOfStuff wrote (View Post):
I must be missing something, this only explains how to extract SHP files as PNG's? :P


It does. But I was too lazy to extract the info. Updated the first post =)

Petrenko wrote (View Post):
Can i get a indexed .png please?


Not right now, I am not at my usual computer. I am sure there will be another volunteer.
Back to top
View user's profile Find all posts by wusche1 Send private message ICQ Number
BaronOfStuff
Level: 48


Position: Registered User
Joined: 22 May 2011
Posts: 312
Kel: 332  [ Donate ]

Online Status: Offline
PostPosted: Thu Feb 09, 2012 11:55 am  Reply with quote

Ah, cheers. This is great stuff, and has just made converting everything about 500x faster for me.
Back to top
View user's profile Find all posts by BaronOfStuff Send private message ICQ Number
wusche1
Level: 35


Position: Registered User
Joined: 10 Jan 2012
Posts: 58
Kel: 70  [ Donate ]

Online Status: Offline
PostPosted: Thu Feb 09, 2012 12:30 pm  Reply with quote

BaronOfStuff wrote (View Post):
Ah, cheers. This is great stuff, and has just made converting everything about 500x faster for me.


My pleasure. I added some more links to the post.

@Petrenko: I posted the PNG as requested.
Back to top
View user's profile Find all posts by wusche1 Send private message ICQ Number
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1