Thursday, March 31, 2011

journal 3/31

Ok, so here is an equation for HSV to RGB. Honestly, the easiest to understand was wikipedia, so that is where I go this.



Given a color with hue H ∈ [0°, 360°), saturation SHSV ∈ [0, 1], and value V ∈ [0, 1], we first find chroma:

C = V \times S_{HSV}\,\!

Then we can find a point (R1, G1, B1) along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value X for the second largest component of this color):

\begin{align}   H^\prime &= \frac{H}{60^\circ} \\   X        &= C (1 - |H^\prime \;\bmod 2 - 1|) \end{align}
  (R_1, G_1, B_1) =     \begin{cases}       (0, 0, 0) &\mbox{if } H \mbox{ is undefined} \\       (C, X, 0) &\mbox{if } 0 \leq H^\prime < 1 \\       (X, C, 0) &\mbox{if } 1 \leq H^\prime < 2 \\       (0, C, X) &\mbox{if } 2 \leq H^\prime < 3 \\       (0, X, C) &\mbox{if } 3 \leq H^\prime < 4 \\       (X, 0, C) &\mbox{if } 4 \leq H^\prime < 5 \\       (C, 0, X) &\mbox{if } 5 \leq H^\prime < 6     \end{cases}

Finally, we can find R, G, and B by adding the same amount to each component, to match value:

\begin{align}   &m = V - C \\   &(R, G, B) = (R_1 + m, G_1 + m, B_1 + m) \end{align}

Color Blindness try 2


Click here for the new code.

This pic is for use of the new code on the original pic in the last post. I would have never figured out that I had to use the "image." stuff to get my layers and channels if not for Tess. I couldn't find anything like that on google. But if you read the code, I have commented on almost every line to make it easier to understand what each thing does.

Wednesday, March 30, 2011

Color Blindness, try 1

Ok, so I have been working on this the color blindness project for about 6 hours now and I still haven't gotten farther than opening my document and creating 2 new layers. That was trying to duplicate what we did in class on Tuesday. I have spent tons of time searching the internet for helpful information, but that is just hard to come by.

I did, however, figure out how to code the pathway to the button in photoshop that automatically turns the picture (for lack of proper vocabulary) color blind. So this is the end result for Deuteranopia (red-green color-blindness). (click hereto go to my code)


I know it looks slightly washed out, but I think that's because the original has so much red and green.


That all being said, I'm going to try and keep working on the way we did in class. Hopefully I can figure it out, or maybe someone can help me.


I would also like to figure out a way to make an image of Tritanopia (blue-yellow/green color-blindness). It's more rare. And, personally, I like the color scheme better.

Sunday, March 27, 2011

HDR Image

(merged image)

I tried the HDR image automate tool in photoshop to see how it worked.
These are the pictures I took that were used to make the merged image.


The only thing I found problematic was that near the outdoor light was some pixelation. It may be the blinds being in the way or it may be that my tripod is fairly old and unstable. Either way, the automated script worked well.

Thursday, March 24, 2011

journal 3/24

After searching google for a long time, I still haven't found one solid scripting tutorial that has everything in it. I especially can't find ones with for loops.

So what I did instead was use the extendscript toolkit to look at the sample scripts that come with photoshop. Honestly, they are a lot more helpful than anything I've found on the internet. Most of the sample scripts are really well commented, so it's easy to see what each line is doing.

I know that's not the most traditional answer, but I figure looking at scripts that already work can help me write new scripts.

(p.s. The post before this does have a recommended tutorial. I still recommend that one for simple understandings.)

Photoshop Tutorial

This site here gives a very simple tutorial of scripting in photoshop. It is actually quite helpful because it doesn't go too far in depth. It shows how to use an if statement, name a variable, and shows the different types of things like actions and conditions. The nice thing is that it explains clearly and concisely what the code it shows does.

It makes the active layer invisible (or become visible if it is already invisible) and shows warning pop-ups for no active document or if there's only a background layer.

I will post another tutorial if I find one that is actually this helpful.

Wednesday, March 23, 2011

Hitting a Snag

So I'm supposed to put up here the best tutorial I can find for scripting in photoshop. I will do that as soon as I can get that script listener to work.

I put it in the right folder and restart photoshop, but it still doesn't start or put a log anywhere on my computer. I reinstall and move the plug-in around, but I just don't know what's wrong.

I figure getting this to work is pretty important, so that's my focus at the moment.

Sunday, March 20, 2011

Journal 3/20

So anyone who knows me knows that I am addicted to Harry Potter. And I am not exaggerating on that. This weekend was a Harry Potter weekend on ABC Family, so I figured I'd post about it.

The thing about the Harry Potter movies is that even though they are fantasy and use tons of CGI, all of it looks wonderfully real. The computer imposed images match perfectly with the live action filming, which is quite rare.



So even though we have learned how to use Maya, nothing I have seen has been quite realistic enough. As much as I don't really like animating, I would still like to be able to make something that could be placed seamlessly along a live image.


Picture here

Tuesday, March 15, 2011

journal 3/15

I was looking through youtube to find a tutorial for photoshop when I ran across this video:

http://www.youtube.com/watch?v=eneyl4KS99A


It's not for photoshop, but it is really interesting and is something I really want to try to work with.

Thursday, March 10, 2011

Journal 3/10

I've still had my mind stuck on color and also on stars. I was wondering why if you stare at the stars for a long time that they sometimes change color (or at least look like they do). This is what I found:



Stars That Change Colors


I've noticed that a few bright stars near the horizon seem to be very rapidly cycling through colors. They'll change from red to green to blue very quickly, it's almost like watching a Christmas light. There are only a few stars that do this, but it's the same ones every night (I know Arcturus is one for sure). All of the stars are close to the horizon and very bright. However, there are some close to the horizon bright stars which do not exhibit this behavior. Why does this happen?
  1. The effect you're seeing is almost certainly due to refraction in the atmosphere. The probable reason that only certain stars seem to change color is that it requires a certain light level before the human eye can distinguish colors (lower than that, you only see a grayscale). So only the brightest stars (Arcturus is the fourth brightest, fifth including the Sun) will exhibit this type of sparkling. Dimmer stars only twinkle (move around and change brightness).

    Dr. Eric Christian


Doppler Shift Vs. Intrinsic Color of Stars

A distant star might appear blue, due to its temperature. If it is travelling away from you, you could use its Doppler shift to determine what is going on. As I understand it, an object approaching is blueshifted, and departing it is redshifted. How could a blue star be red, or a red star be blue?

There are two processes involved here. One is the "intrinsic" color of the star, which is the color someone would see if they were not moving towards or away from the star. That color is completely determined by the temperature of the star. Blue and white stars are hotter than our Sun, red and orange stars are cooler. Each star actually emits a broad range of colors, but the peak emission (the color that has the most light) is what determines the star's color.

An observer sees all of the colors that the star emits shifted either towards the red or the blue depending upon whether the observer is moving away or towards the star. An intrinsically red star moving very quickly towards the observer "would" appear blue, and an intrinsically blue star away very fast "would" appear red. Most stars are not moving quickly enough for them to shift from red to blue or vice versa and we observe them at nearly their intrinsic color. But because of narrow "emission lines" that stars give off (very specific colors from one element), scientists can measure small red and blue shifts even when its overall color doesn't change.

Dr. Eric Christian
(March 2003)



I got this info here: http://helios.gsfc.nasa.gov/qa_star.html

Thursday, March 3, 2011

Assignment 3 part 2 (modifier)

I did get the artistic color wheel to look better and have the saturation. Honestly, when it was discussed in class, all of it went right over my head because my rgb color wheel was done differently. Fortunately, Tess was able to explain it to me and help me understand exactly what each step did.
https://docs.google.com/document/d/1wH4gxC6-8nyruxwfRoQi_62SMTtQZin1jSVcVuxHqVk/edit?hl=en&authkey=CPq204oF

Assignment 3 part 5

As I said in an earlier post, I really wanted to make someone see a "forbidden" color. I wasn't able to do this in maya alone, but I do have the "recipe" at this link: https://docs.google.com/document/d/1eJyPotwIHs1XskDhxGI2AvNRvcHW9x8zF_ovxoey__0/edit?hl=en&authkey=CPPRhq0P

While watching this, I found that if you stare at the middle stripe (initially blue) it works better. I know when I look at it I'm seeing a yellowish blue, so hopefully it will for everyone else.

You can watch it at this link:
http://www.youtube.com/watch?v=W4BNAkqgYAE

Assignment 3 part 4

This part is much like part 3, but the transitions were to non-linear (so go through another color rather than white or black or gray). This was fairly easy. Again, all I had to do was alter the setAttr section again.

Code: https://docs.google.com/document/d/1uxb6DQSCZl_aDBIZC0vhfEwL1d5L5ePLE2iHpJJ6N6o/edit?hl=en&authkey=CODPlPkM Code: https://docs.google.com/document/d/1lq9ODVo4ACRIm4B8FJDcUoMNGVrJqMFa8JZLNV0uG_M/edit?hl=en&authkey=CKzc4rcB
Code: https://docs.google.com/document/d/13KmL0dZhuViNvhdTwV4j0_V6hdNNj5qZdwN_dvqpVlA/edit?hl=en&authkey=CJPw44ID

Assignment 3 Part 3

For this part we were to create 3 linear color transitions. All of mine go through white. That being said, I was under the impression that these were to be actual strips that do the transition, so that is why the end of each code is huge. What was nice about this part of the assignment was that I only had to change the setAttr section to change the colors at the ends. Link to my code: https://docs.google.com/document/d/1qTbYzs93AC7OJ3vThTIWiT6b1UfB-_CeduSnGpQg9WA/edit?hl=en&authkey=COLypoQG

Code: https://docs.google.com/document/d/1CyaEXrD0v1f-dY-30JzM11YTVc7tAuoVUcXX4uwCcog/edit?hl=en&authkey=CNHYnpgJ
Code: https://docs.google.com/document/d/1VsdZ4HtfhcqVvWVLpxfRjsO_SevKAcZIZ5hsL6vqOLg/edit?hl=en&authkey=CMzr_7ED

Assignment 3 part 2

This part was to create two color wheels. The first I did was the RGB color wheel. Using my old code from the color cube, I was able to start off. I worked with a few others from the class and we figured out how to correspond the color to the place on the wheel. Once we figured out how to do the hsv to rgb conversion, it looked much better.

Here's the link to my code: https://docs.google.com/document/d/1WGOWGIQBR-m9HN_QJ08wuVXUSm-Ed1gR935Ug7mUvmw/edit?hl=en&authkey=CPeVqvoD


The second was the artistic color wheel. I had a much harder time with this one. I took the idea from Casey about corresponding the rgb color to a certain angle. I was not able to figure out how to make this work with the hsv, so there is no gradient. It's also not as fluid as the rgb wheel (nor is the code nice and short), but it does match what the artistic color wheel looks like.
Here is the code: https://docs.google.com/document/d/1XoeYeQwgFbesAcw272WjZ3FKCRxTWkoxTk0sYs8psys/edit?hl=en&authkey=CMjb7MEO

Assignment 3 Part 1



For the sake of being completely thorough and to make sure I get graded for this part of the assignment, I am going to re-post the color cube.

The code is here:
https://docs.google.com/document/d/1mb2ro2L_Zeky9N0xnU4rBmhgOhHEG9TvPWdz12pVcnM/edit?hl=en&authkey=CPTWhNoI

Wednesday, March 2, 2011

Journal 3/2/11

I have been thinking about the forbidden colors recently (a yellowish blue and a greenish red). I think I am going to try and figure something out with them for the last part of our assignment, I just don't know how yet.

I found this article :
http://www.scientificamerican.com/article.cfm?id=seeing-forbidden-colors

I'm looking for more to see how I might be able to create a forbidden color.

Tuesday, March 1, 2011

Journal 3/1/11

In class, the subject of how eyes see color was brought up. And then on the class blog there was a post on why glass was transparent.

These got me thinking about how glasses work. They are obviously transparent, but they improve on what the eye sees.

I found this article to help answer my questions on what glasses actually do:
http://www.ehow.com/how-does_4564464_glasses-work.html