Results 1 to 3 of 3
- 11-09-2012, 11:11 PM #1
Member
- Join Date
- Nov 2012
- Posts
- 3
- Rep Power
- 0
Converting image into a "night time" effect (changing pixels colors)
Hey guys!
So I have to convert an image into a night time view.
Here is what the questions asks:
The night-time effect is created by modifying each pixel’s color based on how different (far) it is from “sky-blue” (Color(58,117,197)). For each pixel, the color distance between the pixel’s color and “sky blue” is computed. Each color channel of the pixel is modified by the ratio of this distance value and 311 (the maximum distance) such that “sky-blue” becomes black (the ratio is 0) and the color most distance from “sky-blue” remains unchanged (ratio is 1).
I have NO clue of what to do or where to start.
Any and all help is greatly appreciated!
Thank you so much in advance!
Oliver.
- 11-09-2012, 11:45 PM #2
Re: Converting image into a "night time" effect (changing pixels colors)
I'd have a look at the BufferedImage API to get started.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 11-10-2012, 10:27 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
Re: Converting image into a "night time" effect (changing pixels colors)
For every color (r, g, b) compute the distance w.r.t. (57, 117, 197); let this distance be 'd'. Next computer (r*d/311. g*d/311, b*d/311) (*) and voila.
kind regards,
Jos
(*) 311.5397245938 to be more accurate.When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Convert string operation symbols "+", "-", "/", "*" etc.
By Googol in forum New To JavaReplies: 3Last Post: 10-30-2012, 03:06 PM -
Changing the color of "setToolTipText"
By Y. Progammer in forum New To JavaReplies: 7Last Post: 02-27-2010, 06:53 PM -
Changing colors of an image in real time
By chale in forum CLDC and MIDPReplies: 0Last Post: 05-06-2009, 03:04 PM -
"source not found" at debug time when creating new class
By rafamd11 in forum New To JavaReplies: 0Last Post: 11-22-2008, 01:49 AM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks