• Welcome to World Machine Community. Please login or sign up.
 
September 20, 2019, 12:54:29 am

News:

Read the Development Diary for an inside look at World Machine's progress!


Anding a new color scale

Started by Vorg, January 19, 2004, 12:52:50 pm

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Vorg

I wanted to use a color patern I made for Leveller. I found WM uses a TGA with the a 1x256 palate. So I made a ramp in Leveller and with shading off, exported the overview.  I made the map over side, and then I Paint Shop Pro I scaled the map to 1x256. The band looked right, So I increased the canvas size for the tga from 5x256 to 6x256 and cut and paste the new band at the bottom and saved it. I then added a line to the colors.txt file and tried it.

The old colors are unchanged, but the new one comes out as a sycodellic contour map. It's like it sampled the color map at random.

Fil

That is odd!

I just added a gradient to colors.tga and color.txt to see if something would come up, but I mannaged to get my gradient working properly.

I used Photoshop instead of PSP, though :-P
When saving, I chose 24 bit tga..

If you open your color.tga file with your color gradient with an image viewer, do you see the gradient as you expect it to be?
There can be only 3 causes:
.either PSP saved it wrong,
.WM read it wrong,
.human perception spoiled things (sometimes I get confused with the ilumination and stuff)

To test for the first one: open the image again to check if everything is ok
to test for the second one without having problems with the third: open WM and create a gradient device, and then see the preview (you should see you gradient in the same position as you placed it in colors.tga)

If the problem is in WM reading it, I would be curious to take a look at the colors.tga file, if you don't mind.
If the problem is in the PSP saving the file, we can talk about it next. (you may not need to rescale the image.. you can simply crop it. I remember using some image software that added unwanted transparencies to rescaled layers)
Fil.

Vorg

all looks ok, I put the file on my ftp. Besure to have pasv mode on.

ftp://216.183.70.36:2400/Pub/colors.tga

Vorg

When I added the new color, I did it while WM was still up since it should only need to use the file when selecting a new color pattern. I just tried to start WM with the new tga and it gave some error about invalid file tga and then crashed. And now it seems when somthing crashes on this crap windows and it tries to make one of those worthless error logs, it locks up the computer requiring a hard reset. Since do to the pethetic design of windows, that does even more damage, I can't test this problem.

The file should have worked. I added the color band and saved. I didn't "save as" or anything else to change any format. It is still at 24bit tga.

Fil

Ok, I got it..

This another issue related to WM not reading all types of TGAs.. Using a binary editor, I opened both tga files (yours and the original colors.tga).
WM v.99 reads a tga that starts with "00 00 02" and not "01 00 02" as the one you saved.. What you need is to save the file in a way that WM will open correctly :-P

This is so easy to say, isn't it? :)

Ok, I have no clue of what to do in PSP to get a decent TGA.. BUT I have opened your file in photoshop ans saved it. I left it here http://immi.inesc-id.pt/~fil/wm/vorg_colors.tga

Check to see if this is what you were expecting!
Fil.

Stephen

I took a look at the TGA that is produced, and it is an extremely odd one compared to the standards. It should be a Type-2 RGB TGA, but that file also includes a color map (which is then ignored), a 1-byte unused image ID field, and a couple other oddities.

WM's TGA handling is most definitely not very robust -- It can read TGAs produced by Photoshop and other image creation tools that create typical Type-2 TGAs. But it can't handle the image that has been created here.

I don't really have a workaround, other than saving it from a different image editing program. WM 1.0 will have a more robust file library that also supports more file types.. but until then a workaround will be needed.
-- Stephen Schmitt
- Creator of World Machine

Vorg

you'd think PSP would save the file in the format it was opened in :(. I just opened a TGA and started a save as. Checking the options, it just 8,16 or 24 bit deapth and compressed or uncompressed.

Thanks fil for the corrected file. It works with one minor problem. I GOT THE FIRGIN BAND REVERSED !!! :( Ended up with blue peaks and white at the deapest points.

Fil

You say you used "Save as".. What if you use "Save" only? I don't know, if using save, PSP will save in the same file type..
I know you don't want to crash you computer, but if the type of the image saved using "save" and "save as" is the same, then they should have the same size. (If Stephen is correct about more information in the "save as" type file, then that should be a larger file than the on WM reads)

So compare the sizes of the file using "save" and "save as"..  If they're the same, you have to find some other program that converts to the type-2 TGA..

There is a less Crashy way to test if WM can read files.. Which is to create 256x256 TGAs and inport them through a file input.. I think that won't crash WM..

PS - did you look at the file I converted for you?
Fil.

Vorg

No, I just used save the first time. I went back in and tried save as to see what options it has when the save created the bad file. PSP is making the changes on it's own.

And yes the file you fixed loaded just fine. I just put the color band in backwards.
------------

Just tried some things checking file size. opened the file you fixed (size was 5k). Did nothing else but hit save and file went to 6k. I then tried save as with both compressed and uncompresed and both where 6k. Only other option is bit depth.

Tried somthing else. I use InfraViewer as my primary viewer. So I simply double clicked one of the 6k files made by psp, then went to save and found it also has an option to open files in hex mode. With out making any changes I simpley said save and the file went back to 5k. Havn't tested it yet. Also noticed Infraview has no options for saving TGA files. Has options for other file types. Nice little program.

Vorg


morbidorbits

Paint Shop Pro 7 used to create World Machine friendly TGA's but Version 8 does not. I tried all variations and couldn't get any to work. Are you using PSP 8? There is an update to PSP 8.1 (i think) I don't know if this will fix the TGA problems though cos I haven't upgraded.

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S save/post or ALT+P preview