Author Topic: Got a math question  (Read 2602 times)

Justin

  • friend
  • Senior Member
  • ***
  • Posts: 622
Got a math question
« on: September 27, 2005, 07:45:48 PM »
Ok, I really suck at figuring out how to make math give me the answers I need, and have come to a point where I have a problem that only math can solve, but haven't the slightest idea how to do it.  So for those of you who get off on pushing numbers around, this thread's for you.

Think of it as a story problem.

Justin has received from a client a Photoshop image that uses the RGB color space.  The color of each pixel in the image is a combination of (R)ed, (G)reen, and (B)lue.  In PhotoShop, each of these three primary color values can be defined in a range of 0-255.  So to define any color, PhotoShop uses R=0-255, G=0-255, B=0-255.

Now, the Photoshop image is nothing more than a storyboard concept for an animation Justin has to create in SoftImage XSI, a 3d program.

XSI, being made by the contemptibly obstinate French uses a different numbering system for the values of RGB.  Instead of ranging from 0-255 for each of the three primary colors, they use a decimal range of 0.000-1.000  So any given color can be defined in SoftImage using the following: R=0.000-1., G=0.000-1., B=0.000-1.000

Now, this particular client is very persnickety about details, and it's important that Justin get this color spot-on in his animation.  How can he convert the PhotoShop color values of Red=0, Green=103, and Blue=143 to a decimal somewhere between 0.000 and 1.000 for each of these three color values?

This is an open-book, open note, calculator test.  Please show your work.  No ink pens.  Please begin now.
Your secretary is not a graphic designer, and Microsoft Word is not adequate for print design.

Guest

  • Guest
Got a math question
« Reply #1 on: September 27, 2005, 08:19:25 PM »
I know one thing: you can best skin this cat with a computer program.  Put one value (or set of three values) in, get the equivelent out.

It's a percentages problem.  What percent of, well probably a third value, is each known number.

Photoshop's values are 0 (0%) to 255 (100%).  The Froggy numbers can be translated to percentages too.  Percentages in turn are easy to calculate.  ..so there's your third value that each are translated to: plain ol' percentages.

Upshot: write a translator percent-to-photoshop-and-back, another percent-to-Froggyjunk-and-back, and a compare routine in the middle.

A better programmer than me will be along shortly I'd expect Smiley.  I'm way past "rusty" Sad.

Justin

  • friend
  • Senior Member
  • ***
  • Posts: 622
Got a math question
« Reply #2 on: September 27, 2005, 08:45:50 PM »
Thanks Jim! That's all I needed.

All I need is to convert the 0-255 values to a percentage, and there's tons of websites out there that can do this.

From there, I can convert whatever the percent is to a decimal just by looking at it.
Your secretary is not a graphic designer, and Microsoft Word is not adequate for print design.

Guest

  • Guest
Got a math question
« Reply #3 on: September 27, 2005, 08:56:17 PM »
Yeah.  Yeah, that'll work...the Froggy numbers are basically percentages already.

Guest

  • Guest
Got a math question
« Reply #4 on: September 27, 2005, 09:19:29 PM »
I was doing some searches anyway...found their forum : http://www.xsibase.com/forum/index.php?board=1

Gotta be a cheat sheet in their somewhere...I thought I saw some free downloads and tools for trial as well.

I am not to this level in my studies...after perusing some of this stuff...what I am trying to learn does not seem so bad afterall...


Here is one math site- http://www.algebra.com/algebra/homework/#prealgebra

Justin

  • friend
  • Senior Member
  • ***
  • Posts: 622
Got a math question
« Reply #5 on: September 27, 2005, 09:29:20 PM »
Sm, I'm a member of XSI base, and I agree, it's a fantastic resource.  To be fair, I started out animating in 3d Studio Max, and only within the last couple of years switched to XSI.  While XSI is more convoluted, I've found that it's user community is one of the most helpful on the web.

Incidentally, whatcha studyin'?
Your secretary is not a graphic designer, and Microsoft Word is not adequate for print design.

280plus

  • friend
  • Senior Member
  • ***
  • Posts: 19,131
  • Ever get that sinking feeling?
Got a math question
« Reply #6 on: September 28, 2005, 12:34:20 AM »
Actually, unless I'm wrong of course, the froggies have GIVEN you the percentage you need. If their # (for example) is .83 then you want 83% of that color. You would then take 255 MULTIPLY IT by .83 and you should have your answer.

If you neeed to know the reverse: "what % of 255 is 103?" It becomes a division problem. Divide 103 by 255 to get the percentage. I got 50.98 for an answer.

What: X
of: x (multiplication sign)
is: =

Formula: X% x 255 = 103. You would Divide both sides by 255. This cancels the 255 to the left of the equals sign leaving only X% and as already posted 103 / 255 = ~51 on the right.

Finally all those dreaded algebra classes pay off...

Smiley
Avoid cliches like the plague!

jefnvk

  • friend
  • Senior Member
  • ***
  • Posts: 1,478
  • I'll sleep away the days and ride the nights...
Got a math question
« Reply #7 on: September 28, 2005, 04:15:59 AM »
Going from photoshop to the other one, take your photoshop value and divide by 255.  Therefore, [0,103,143] in photoshop would be [0,0.4039,0.5608] ([0/255,103/255,143/255]).

To go from the other to photoshop, take the decimal and times by 255.  [0*255,0.4039*255,0.5608*255] becomes [0,102.995,143.004], which can be rounded.
I still say 'Give Detroit to Canada'

Zundfolge

  • friend
  • Member
  • ***
  • Posts: 143
Got a math question
« Reply #8 on: September 28, 2005, 06:38:21 AM »
What happens if you create a 72px x 72px RGB document in photoshop, fill it with your desired color, select all, copy, paste it into XSI ... does it convert the color for you?


keep in mind that just because you figure out the proper percentage that doesn't mean thats how it will interpret the color.


Color from one program to another is basically voodoo.


Besides that if your client is too picky they will NEVER be satisfied because R 156 G 220 B 105 will look very different on two different monitors.


Clients that DEMAND color accuracy in any medium other then print are likely SOL (and then only if you're using spot color ... or if they want to join you on a press check if its 4 color).

Guest

  • Guest
Got a math question
« Reply #9 on: September 28, 2005, 07:36:06 AM »
Justin-
Taking the Cisco Curriculi. Currently CCNA I [LAN]. Also taking Intro to Database, and Intro to Programming. Both of the later strictly on line. All the Cisco is through Online text as well, and as we know, all exams and quizzes are online as well. I just have to be on campus to do the hands on and lab portions. Like using a crossover when I was supposed to use a straight cable...oops.

Gives me change up from doing the conversion from Binary-Decimal-Hexidecimal wrong tho'. I got a feeling I am going to "really enjoy" IP addys and submasking.


I do appreciate everyone sharing about Justin's question. This CIS/IT is a new language to me. I spent 35 years doing something I knew all the math, the nooks and crannies about. Knew every mfg, supplier, how to use every tool and whatnot.

"I" did not fall for the "Go down to IT room 303 and see if they have our Transmission Closet Stretcher.".

Just because I am the eldest student in the class, older than my instructor even - well - my past real world expereinces do come in handy.

Yes the three younger guys actually got the keys from Mr. G in room 303 and went to the  First Floor to get the "stretcher"...Mr. G said "the students last used it were supposed to leave in room 102  when finished".

Instructor, myself, a few others went to get coffee at the snack area. We left a note for the 3 guys, we still got back before they did. Seems a note said the "stretcher" was being used in the Admin Bldg. We sipped coffee and observed them heading to Admin Bldg.

Some stuff is totally new to me. Then again - some things never change.

"Cannot find who used the Cisco Tx 54 stretcher last, can we still get this project done without it? "  Cheesy

Standing Wolf

  • friend
  • Senior Member
  • ***
  • Posts: 2,978
Got a math question
« Reply #10 on: September 28, 2005, 01:51:15 PM »
Quote
Color from one program to another is basically voodoo.
If it's even that scientific!
No tyrant should ever be allowed to die of natural causes.

jefnvk

  • friend
  • Senior Member
  • ***
  • Posts: 1,478
  • I'll sleep away the days and ride the nights...
Got a math question
« Reply #11 on: September 28, 2005, 02:59:29 PM »
Quote
Besides that if your client is too picky they will NEVER be satisfied because R 156 G 220 B 105 will look very different on two different monitors.
Excellent point.  I had a webpage that was orangeish-yellow on a laptop monitor, and neon yellow on a CRT once.  Not a thing I could (or was willing) to do about it.
I still say 'Give Detroit to Canada'

Nathaniel Firethorn

  • friend
  • Senior Member
  • ***
  • Posts: 522
  • Extra Thorny
Got a math question
« Reply #12 on: September 29, 2005, 09:37:44 AM »
Quote
How can he convert the PhotoShop color values of Red=0, Green=103, and Blue=143 to a decimal somewhere between 0.000 and 1.000 for each of these three color values?
Ans: He can't. 103/256=0.40234375, so he's going to lose five digits to roundoff error.

Of course, the precision of the original colors isn't known, either.

And by the way, the question is poorly stated. Do they want a color vector or an algorithm to convert color vectors from Rest of the World to French?

It's not easy being 0x00FF00... Wink

- NF
Give up no state. Give up no ground.

http://www.njcsd.org

P95Carry

  • Member
  • *
  • Posts: 437
Got a math question
« Reply #13 on: September 29, 2005, 11:13:36 AM »
I just wonder what the heck is wrong with 0 thru 255 decimal or the binary and hex equivalents.  

They are totally logical, being based naturally on binary.  Thus one byte has 0000 0000 to 1111 1111 states, or 00 to FF in hex - what could be simpler, without someone comin along with 0 thru 1,, sheesh Cheesy.

It's my age ya know!
Chris - P95
Guns don't kill people - people kill people.
NRA Certified Instructor & NRA Life Member.
Rohrbaugh interest/ownership? - Rohrbaugh Forum Rohrbaugh R9 FAQ Site