Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Determine the dominate color of an image?

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jan 2010 16:56 Edited at: 16th Jan 2010 17:47
Have you ever seen those pictures that are made up of several smaller images? But when you stand back from it, you'll see a face that's been created out of magazine covers or something. When you stand back, each magazine cover appears to be a single pixel, sort of, and has a dominate color or shade that stands out.

Examples


Given the smaller images or tiles, how could I determine what shade that would appear to be? Would it be just an averaging of all pixels?

Edit
This was suppose to be in the DBP board, but it's a language independent question anyway.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Jan 2010 18:27
That sounds about right. Average the entire tiny picture tile to get a general shade of that picture. Then divide the main picture into the max number of tiles you are going to use and average each tiles pixels to get the shade of that group of pixels.

Then match shades or closest shades between the tiled main picture and the little pictures.

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Jan 2010 19:49
Those are pretty impressive. What's really clever is that they aren't treated as individual pixels, different shading in the pictures is used to create curved edges and other effects.
You could certainly sort all of your images by average colour and then choose the most appropriate for the effect you want.
Are you planning to make something with this or are you just curious?

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 17th Jan 2010 21:20
Photoshop has Filters / Blur / Average, and that might give you the result, and save time writing a special program.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Jan 2010 07:51
It was for a special minimap system I was thinking about.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 19th Jan 2010 21:53 Edited at: 19th Jan 2010 21:55
Quote: "It was for a special minimap system I was thinking about."


I mean use Photoshop to create the RGB data, rather than scan all of the pixels one at a time. Put each picture in a folder with a number. Then put each Photoshop blur in another folder with the same number. Now you can get the RGB for all of your pictures very quickly.

Login to post a reply

Server time is: 2024-04-19 07:44:50
Your offset time is: 2024-04-19 07:44:50