Results 1 to 3 of 3
  1. #1
    od11kd is offline Member
    Join Date
    Nov 2012
    Posts
    3
    Rep Power
    0

    Default 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.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default 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!

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,538
    Blog Entries
    7
    Rep Power
    20

    Default 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.
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2012, 03:06 PM
  2. Changing the color of "setToolTipText"
    By Y. Progammer in forum New To Java
    Replies: 7
    Last Post: 02-27-2010, 06:53 PM
  3. Changing colors of an image in real time
    By chale in forum CLDC and MIDP
    Replies: 0
    Last Post: 05-06-2009, 03:04 PM
  4. Replies: 0
    Last Post: 11-22-2008, 01:49 AM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •