Page 1 of 6 123 ... LastLast
Results 1 to 10 of 60

Thread: Custom picker utility

  1. #1

    Custom picker utility

    Here's a little python utility to convert .col files to custom color pickers, and create picker templates.
    I'm not sure if it will work, please help me test it.

    Linux : http://sites.google.com/site/azathot...2_linux.tar.gz

    Windows : http://sites.google.com/site/azathot...r2_windows.rar

    Just extract the directory somewhere, and then drop a .col file over the executable.
    You can also drop a simple txt file containing an integer, to create a transparent picker template for that amount of colors, which you can then fill up in gimp or photoshop.
    Alternatively, you can use it from a command line.

    There's a more or less arbitrary limit of more than 3 and less than 168 colors per picker. If the .col file has more than that, it will be split accordingly in roughly equal sized parts.

    The png images will be created at the location of the .col or .txt file.

    For linux it's command line only I'm afraid, the drag & drop behavior is different.

    If it doesn't work, please run it from a command line (start> run> cmd) in case there's any messages displayed.

    I attached two examples, created from palettes uploaded to this forum.


    PS: don't forget to scan it for viruses, it's an executable after all. I've included the source in both archives, in any case.


    EDIT: new links, palette from image functionality
    Attached Images Attached Images   
    Last edited by azathothgr; 02-01-2010 at 07:32 AM.

  2. #2
    Join Date
    May 2009
    Location
    3438 ft above sea level
    Posts
    2,950
    OMG that is stoopid cool
    How clever you are !!
    Thanks heaps, this will be getting a lot of use from me for sure

    Works wonderfully on my system... windows XP pro 64bit
    Kaspersky found no viruses

    EDIT: Tried out the text integer method too and its works perfectly as well... fabulous work, thanks again
    Attached Images Attached Images  
    Last edited by Juz; 02-01-2010 at 06:21 AM.
    "I paint because I love to cut mats" (Arthur Alexander)

  3. #3
    Join Date
    Dec 2009
    Location
    Finland
    Posts
    42

    Thumbs up

    Nice work! I had a similar idea earlier. I wanted to create a palette like yours but based on given input image instead. You can find my initial code (Python, uses PIL) here. It just blurs the image, quantizes it and outputs the found colors in a grid of colors.

    Feel free to use the code if you want. It's still missing a smart way to sort the colors (some ideas) and I'm sure there are nicer ways to generate palette than the way I used. I expect a good algorithm would take image content in count better (ie. detect shapes and make sure colors of even smaller shapes are used well) but simple blur + quantize might do for now.

  4. #4
    Join Date
    Apr 2009
    Location
    St. Louis, MO, USA
    Posts
    1,598
    Really nice tool....azathothgr....thanks! I had no issues with using this and very much appreciate you sharing this with us! BTW....one could sort (by hue, name, etc.) the COL in AR and export it as the same name or a different name (whatever floats your boat...!) and then take that sorted COL to create the picker file.

    Here's one that I created using the old gray.col file I got from someone in this forum awhile back!
    Attached Images Attached Images  

  5. #5
    Join Date
    Dec 2009
    Location
    SK, Canada
    Posts
    97
    works perfectly (as far I can tell) And I prefer the color picker to the samples so even better for me

    Thanks
    I don't have digital... I don't have diddly squat
    It's not having what you want... it's wanting what you've got

  6. #6
    Quote Originally Posted by bebraw View Post
    Nice work! I had a similar idea earlier. I wanted to create a palette like yours but based on given input image instead. You can find my initial code (Python, uses PIL) here. It just blurs the image, quantizes it and outputs the found colors in a grid of colors.

    Feel free to use the code if you want. It's still missing a smart way to sort the colors (some ideas) and I'm sure there are nicer ways to generate palette than the way I used. I expect a good algorithm would take image content in count better (ie. detect shapes and make sure colors of even smaller shapes are used well) but simple blur + quantize might do for now.
    Ooo , I'll look into adding that functionality, with your get_colors function. Dropping an image to the exe, and getting a custom palette should be nice =)
    I have absolutely no idea whatsoever how to automatically sort colors, though. It sounds rather complex. Maybe something linear would do , just to keep the palettes visually pleasing, like a hue sort.

  7. #7
    Join Date
    Dec 2009
    Location
    Finland
    Posts
    42
    YIQ sort seems visually pleasing to me. I wrote a simple example of how to do that. You can find it here. It uses colorsys module that's provided with Python. It might make sense to give grapefruit a go at some point considering it supports more color systems, though.

    There probably should be some sort of way to define which sorting method to use (spawn a simple UI on drop or just use some config file?).

  8. #8
    Ok this is the best I can do ..
    I've added the palette from image functionality from bebraw's code, and a sorting method, that I thought made more sense, both for .col and image files.

    The problem with arithmetic sorting is that with so few colors in an average picker, the first sorting priority is going to take over completely. The others won't play any significant role at all..

    So I've done a sort of 'SHL' sorting and grouping. First saturation to get rid of the grays, separating in 3 rough groups of saturation, then Hue, into 10 hue groups, and finally lightness. All values within the same group are considered equal for sorting. That way all the reds (for instance) are together, sorted by lightness, without minute hue differences taking over.

    Adding a gui would be overkill probably, so I've just included 2 exe's, for sorted and unsorted results. The sorting method is hardwired for now I'm afraid.. But you can always sort color swatches from within artrage.

  9. #9
    Join Date
    Dec 2009
    Location
    Finland
    Posts
    42

    Thumbs up

    Nice work! You are quick. This will be extremely useful utility.

  10. #10
    Join Date
    May 2009
    Location
    3438 ft above sea level
    Posts
    2,950
    Fantastic... having the two options is really helpful as there are times where i want to sort and other times when i want to maintain the order of the orignal .col.

    Just wanted to ask what image file types can be used for a palette generated from an image ?

    A huge thank you to both Azathothgr and Bebraw for your work on this great utility
    Last edited by Juz; 02-01-2010 at 08:17 AM.
    "I paint because I love to cut mats" (Arthur Alexander)

Posting Permissions

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