• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Icon Related Request

Status
Not open for further replies.

eejin

Tool Moderator
Level 12
Joined
Mar 6, 2017
Messages
221
So you probably will want take the area in the icon without the borders to start. You will probably want to work in the HSV colour space too. Something easy you could try would be to just use an image library to downscale the image to 1x1.
 

fladdermasken

Off-Topic Moderator
Level 39
Joined
Dec 27, 2006
Messages
3,688
anyone know of a good algorithm to determine primary colors out of an icon?
Depends how far down the rabbit hole you want to go I guess. I never dabbed much with this either, but you could maybe use some form of median cut algorithm, e.g. as done here Color Thief. If you want to go simpler, maybe try using a heavy blur filter to average out the pixel intensities instead of scaling it down.
 
Very cool idea! Here is my input.

upload_2021-1-10_13-27-4.png

upload_2021-1-9_16-23-57.png

upload_2021-1-9_23-4-53.png


upload_2021-1-9_23-5-51.png

upload_2021-1-9_16-29-48.png

I used the Median Cut (Bucket Sort) which @fladdermasken suggested. Wrote it in JS. Pastebin
 
Last edited:
Status
Not open for further replies.
Top