[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3760: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3762: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3763: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3764: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
7Seas Fishing Forum • View topic - How to make a transparent TGA of a fish for aquariums

How to make a transparent TGA of a fish for aquariums

No promotion here please! Discuss building, collecting, and using community catchables and 7Seas-compatible buyables. Any registered user can start new threads here and reply.

How to make a transparent TGA of a fish for aquariums

Postby Jen Shikami » 19 Dec 2008, 05:40

I thought I'd make a little tutorial for all you custom fish makers out there who will be able to add aquarium photos to your fish soon! Please do let me know if this is unclear -- I'll read your suggestions and revise this top post accordingly.

This tutorial is mostly about how to take the photos for the color and alpha layers; how you would actually process them in your photo-editing program of choice is up to you. Google for some tutorials if you'd like.

Your end goal is to make a 32-bit TGA (a TGA with transparency) with dimensions 256x256. This looks complicated but once you get used to it, you can process these photos really quickly! (I would know, we have hundreds of fish and I did the photography for almost all of them...)

Okay, first wear your fish and tell it to stop swimming. Turn off bubbles, too.

Rez a copy of your fish in world; we will end up destroying this fish in the process of photographing it! You have a backup copy in your inventory so this should be OK.

Now, IF your fish has simple edges, no transparency shading, is all one color, and you take a really high-res photo... you can just take a photo against a contrasting background, go into your photo editing program, select the background, use that selection to make your alpha channel, resize to 256x256, save as TGA, and stop the tutorial here. The edges might be a bit messy but maybe you don't care.

BUT, this tutorial assumes you're trying for a more detailed image than that. So, continue. :)

If you're using a fin flapping script, any kind of animation, or flexis that react to wind, you'll need to take a few extra steps to make the fish stop moving now. That way you can get two identically-aligned photos later. Edit your fish and choose Tools > Set Scripts to Not Running in selection. If you have flexis flapping around, set them to not flex.

Raise it up a bit so it's easier to get a good angle. Place it against a flat background (an object you've created, so you can change the color.)

Line up your shot so the fish faces left. (Or you can flip it in your photo editing program later, but don't forget that part!)

Change the time of day in SL to noon.

Adjust the fish's background so it matches as much of the fish as possible. This is especially important if the fish has any transparency in the fins. (more on that later.) If you want an absolute match, you might want to make both fish and background be fullbright. Or just make the background fullbright.

Take a screenshot of the full color fish, filling as much of your screen as possible. Be VERY careful not to change your camera angle afterward!
1prim-example-color.jpg
1prim-example-color.jpg (33.69 KiB) Viewed 17396 times


(This example is square because I already cropped it, but your picture will presumably be rectangular, may have other crap in the background, etc. Don't worry, we will crop it to square later.)

Now -- still not changing your camera angle, this is tricky -- edit your fish to remove all glow and shine. Tint it black.

Make the photo backdrop white, fullbright.

Take another screencap like so:

1prim-example-BW.jpg
1prim-example-BW.jpg (28.69 KiB) Viewed 17450 times


If you were careful not to move your camera, these screencaps should line up exactly, which makes life much easier. If you DID move your camera I suggest you delete this fish, rez a fresh one, and repeat the above steps again.

So, now that you've successfully acquired the two matching shots, you can clean up all the stuff inside SL and shut SL down if you have to.

Go into your photo editing program and open the two photos -- the color one and the black and white one.

You want to make these two layers of the same file so when you crop it, it'll still match up. I don't know what program you're using so... consult an expert in that program for help.

Now, most of this fish is green and the transparent spaces in the wings are green because of the background, so it works out nicely. BUT, the wing edges are black. There's a chance I'll get a green halo (faint green line) around the black part of the wings, which you don't want because ... well, *I* don't want it because I'm a perfectionist. ;) Skip this step if you don't care or your fish is already the same color all the way around as the background.

So what you want here is black edges around the black part of the fins, so you have some leeway to knock out that halo. You can select the background and expand the selection a bit, or just freehand. But either way, paint some black around the parts that need to be black:

1prim-example-color-blackedge.jpg
1prim-example-color-blackedge.jpg (36.57 KiB) Viewed 17401 times


It can be messy, no big deal. Notice I left the fish's stomach alone since that's green on green already.

So now... if you haven't done so already, you can crop your photo to be square. Don't cut it too close on any side. If needed, add background to your image so it can be square (nobody will see that background other than the few pixels right around your fish, so don't worry about the color or whatever.)

Resize to 256x256 pixels.

Remember that neglected black-and-white layer in your document? Reveal that now. You want to invert the colors (again, consult your particular program's peculiarities to figure out how to do this. In Photoshop it's control-I). That will make all the black white, and the white black, like so:

1prim-example-WB.jpg
1prim-example-WB.jpg (28.71 KiB) Viewed 17434 times


If you've done any work with alpha channels before, you'll see that this gives you a perfect alpha mask! The black is transparent, pure white is opaque, and shades in between are various degrees of transparency.

(This is why I recommend TGA rather than PNG... you get nice smooth edges because it allows for all these extra shades of gray...)

So, however this works in your program of choice, use the new white-and-black image to make your alpha channel.

Reveal your color layer again. When you apply your alpha channel, in Photoshop it appears as red. So here's what it looks like in Photoshop at this point:

1prim-example-color-with-alpha.jpg
1prim-example-color-with-alpha.jpg (33.87 KiB) Viewed 17445 times


I save it as a 32-bit TGA. The 32-bit is important since that's the transparent part.

Now, upload your pic into Second Life. In the preview it'll look like this, with the checkered background to demonstrate transparency:

1prim-example-color-checkered.jpg
1prim-example-color-checkered.jpg (44.78 KiB) Viewed 17450 times


See how the middle sections of the wings are still semi-transparent? Nice eh?

Anyway, find the image in your inventory. Set the properties to FULL permissions: mod, copy, trans. This will allow people to use it in aquariums later without actually having a copy of the image. Be sure to never delete this copy of the image from inventory, or all your in-world fish images will break!

Right-click on the image and choose "Copy Asset UUID." It copies an alphanumeric string into your clipboard that looks something like this:
1hhcd8de-166e-4d82-4341-7c79e9e4be40

That's the UUID you'll put into the OpenSeas driver script for your fish (once that script is available.)

So, wear the nice clean ready-to-go version of the fish that is still in your inventory. Plug that number into the script, reset the script, save it.

Take the fish off, wait five seconds to make sure SL really saves what you just did, and wear the fish again. This usually causes the rotation to start back up again, but you might want to turn bubbles back on too.

Click the fish and try loading it into a nearby aquarium. It should work! :D

Hope this helps. Please make suggestions and I'll revise this top post to clarify!
Official builder for 7Seas Fishing. Learn more at http://7seasfishing.com
For technical support, please contact 7Seas Sass by IM in Second Life.
User avatar
Jen Shikami
 
Posts: 36
Joined: 18 Dec 2008, 10:35

Re: How to make a transparent TGA of a fish for aquariums

Postby Firebird Nightfire » 12 Mar 2009, 23:05

Quick question:

Instead of taking two pictures, can you take the first one, copy it, then desaturate it to get your black and white pic? That would ensure that the two of them align right.
Firebird Nightfire
 
Posts: 4
Joined: 12 Mar 2009, 22:30

Re: How to make a transparent TGA of a fish for aquariums

Postby Seven Shikami » 13 Mar 2009, 07:31

Jen's the expert but I'm guessing... no. Desaturate just drains the color, it doesn't provide a true alpha-esque shilouette like the one depicted above. Notice the body is solid black. if you desaturated it wouldn't be black, it'd just be a black and white television version of the fish.
From the workshop of Seven Shikami, Official 7Seas Code Monkey.
For technical support please contact 7Seas Sass by IM in Second Life.
User avatar
Seven Shikami
 
Posts: 144
Joined: 18 Dec 2008, 09:43

Re: How to make a transparent TGA of a fish for aquariums

Postby Redwood Rhiadra » 13 Apr 2009, 15:26

Redwood Rhiadra
 
Posts: 8
Joined: 13 Apr 2009, 14:32

Re: How to make a transparent TGA of a fish for aquariums

Postby Kagehi Kohn » 16 Apr 2009, 00:01

For anyone wanting to get even nicer results:

http://www.5min.com/Video/How-to-Green- ... p-61116048

This shows how to use tools in Photoshop to remove the green background, employing "background eraser", and "fill bucket". The same technique will work, though the commands differ a bit, using Paintshop Pro. However, in that later application, the fill bucket cannot be set to use "clear". So, you have to do all the edges using the background eraser, before doing the other steps. ;)
Kagehi Kohn
 
Posts: 2
Joined: 23 Feb 2009, 22:45

Re: How to make a transparent TGA of a fish for aquariums

Postby Kosh Magic » 21 Jun 2009, 04:16

I have PSP X2. Is there a way you can tweek the tutorial to fit this program?
User avatar
Kosh Magic
 
Posts: 13
Joined: 17 Feb 2009, 04:19


Return to OpenSeas Creations

Who is online

Users browsing this forum: No registered users and 2 guests

cron