Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Color Palette Extractor will be FREE!

Discussion in 'Works In Progress - Archive' started by d-navarro, Feb 27, 2015.

Thread Status:
Not open for further replies.
  1. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    chelnok, gurayg, Kirbyrawr and 2 others like this.
  2. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    419
    Yimmmeny! I've been looking for a tool such as this. Do you require any beta testers? Be happy to give you feedback :)
    Looking at your screenshot, I can see that one may export to C# script... I'm assuming that would be an array of color in RGB 0-1?

    What would be INFINITELY useful, would be if you also provided a selectable field that contained a C# code snippet of the current color that one could CopyPaste into one's scripts. So right under where you have the single swatch, hex, RGB, and HSL values, you would also provide a selectable text area with:
    Code (CSharp):
    1. Color(0.81176f, 0.26275f, 0.00000f)
    Inclusion of the fourth float for alpha could be handled by boolean check box.

    And what about the option to export to Unity's (rather limited) palette implementation what resides in ...\AppData\Roaming\Unity\Editor-4.x\Preferences ?

    Oh... and is it 'mole' like the animal? Or 'mole' like the chocolate sauce?
     
    d-navarro likes this.
  3. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    Thanks FuguFirecracker, some nice suggestions there. If you want to test it before release please email contact@wasabimole.com

    I'm using Color32 instead of Color for the C# output, as it's somewhat shorter. But it would be easy to add a Color/Color32 toggle.

    I really like your suggestion about including the C# snippet in the color picker. I'll include it for sure, maybe in 1.01 release.

    This first version is not exporting to Unity's palette, but it's on my To Do. I have to look at it.

    And wasabimole comes from an old joke my friends used to do, when taking a person to a Japanese that was unfamiliar with that food, and telling them that wasabi was in fact guacamole. Yes ... assholes, I know ;-)
     
  4. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    Version 1.00 was just submitted for review. Fingers crossed.

    I included FuguFirecracker's suggestion (thanks!) of including the c# snippet with the current color, also a Color/Color32 toggle. And this toggle also works for the C# script export.

    wasabimole.com has also been updated with all the info about Color Palette Extractor and the User Guide.
     
  5. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    419
    Gotta say, This looks absolutely brilliant.
    Oh the hassles I've gone through to get nice color palettes for earthtones / skintones / fire / water / eyecolor..!

    And no more trips to http://www.easyrgb.com/index.php?X=CALC to for color conversion.

    Nice.

    Are the exported PNGs 8 bit?
     
    d-navarro likes this.
  6. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    Thank you Fugu, I hope the tool is useful to many people. Still pending review, the Unity guys must be busy with U5 release, GDC and all ;-)

    And yes, the PNG's are 8 bit per [r, g, b, a] channel (32 bit per color)
     
  7. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    Update: This is still happening, although it'll take a little bit longer. Unity Asset Store submissions seem to be quite slow right now, with Unity 5 launch, GDC and all. And I was forced to re-submit when I found out the plugin didn't work on Mac's [Damn OpenFilePanel and multiple extensions!] :)

    So I'm afraid it goes back to the queue again. If anyone still wants to test it before release please contact me. Thanks!
     
    theANMATOR2b likes this.
  8. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Very nice of you to offer for free d.navarro. Thank you very much.
     
    d-navarro likes this.
  9. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
  10. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    419
    Hey! Works great with JPEGs, but PNGs
    fail with the following exception

    Code (CSharp):
    1.  
    2. IndexOutOfRangeException: Array index is out of range.
    3. ‭‍‫‌‎‬‏‌‍‎‌‪‭‪‮‪‪‫‬‫‭‏‭‏‮.‪‍‍‌‭‍‪‭‌‪‍‪‏‬‬‌‮‪‌‏‪‮ (Wasabimole.ColorTools.HSL[] )
    4. ‭‮‬‬‬‌‫‍‬‭‎‪‪‪‌‭‌‍‮‮‫‪‫‮+‬‮‪‎‬‏‏‭‭‮‭‬‏‍‭‪‍‌‫‫‍‮‪‮.MoveNext ()
    5. Wasabimole.ColorTools.ColorPaletteExtractor.Update ()
    6. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    7. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    8. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    9. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    10. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:244)
    11. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:237)
    12. UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:294)
    13. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/EditorGenerated/EditorApplication.cs:235)
    Unity 4.6.3 p4
     
    d-navarro likes this.
  11. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    I have tried it with a few PNGs, and it works for me ...weird. Could you email me one of the images that fail to d.navarro@hotmail.es? Thanks!
     
  12. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    419
    I did some further investigation on your behalf.

    Concerned it might be the PNG spec as output from TheGIMP, I ran the image (my logo) through PNGQuant and tested that... Then the Quantified PNG sent through OptiPNG to strip out any residual metadata what might possibly confound your implementation...

    Same errors
    Here's what showed in the ColorPalette window: No image. Just a small red ?

    Where was that coming from?

    SO... Your addon wasn't loading my files. The "index out of range" error was because there wasn't anything there to work on.

    Funnily enough, every JPEG I processed was located on my C:\ drive. They worked.
    Every PNG file I attempted to process was located on my F:\ drive. They failed.

    I moved my PNG file to my C:\ drive, and sure enough, it worked.
    The JPEG I tried from my F:\ drive, failed.

    So there you go... There appear to be some hard-coded path issues in your code.

    I hope that was of some help.
     

    Attached Files:

    d-navarro, chelnok and hopeful like this.
  13. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    Oh, wow! Great work, you deserve some credit, and a medal! :)

    Thank you a lot. Like it sometimes happens, I did a thousand tests, but I never tried loading from a different drive ... doh!

    Must be something silly, I'll fix it tomorrow and send you the fixed version if you want (or anyone else, for that matter).
     
  14. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    I was loading the image with www.LoadImageIntoTexture(), and it turns out it fails when using a file://path with another drive (?). Anyway, Texture2D.LoadImage() works, so I already submitted a fixed version (as 1.01).

    Hopefully it won't take too long to go through review.

    Thank you again FuguFirecracker! If you want, I can send you the fixed version directly.
     
  15. d-navarro

    d-navarro

    Joined:
    Apr 27, 2013
    Posts:
    75
    Color Palette Extractor 1.01 is now on the Unity 3D Asset Store.

    1.01 Open image fix
    - Fixed opening images from another drive
    - Small bug fixes

    Asset Store link: http://u3d.as/bXB
     
    FuguFirecracker likes this.
Thread Status:
Not open for further replies.