Search Unity

2D Sprite Colorize in three tones???

Discussion in '2D' started by Vugar-Naib, Aug 30, 2015.

  1. Vugar-Naib

    Vugar-Naib

    Joined:
    Aug 28, 2015
    Posts:
    8
    Hi every one!
    I have question about сolorize texture using effects like tritone in after effects by tweaking shadows, midtones and highlights. This would help to diversify the game on the basis of a one texture or animated atlas.
    See image! Is it possible to Unity?
    PS. sorry for my english
     

    Attached Files:

  2. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,153
    sprite renderer -> color ?
    and from script something like: GetComponent<SpriteRenderer>().color = Color.blue;
     
  3. Vugar-Naib

    Vugar-Naib

    Joined:
    Aug 28, 2015
    Posts:
    8
    I was expecting so too, but experience has shown that in such a case I lose the highlights colors.
    Possible that a C# is out to make, but the algorithm is more complicated than just appeal to the RGB channels.
    Thank you for participating! =)
    See image!
     

    Attached Files:

  4. Vugar-Naib

    Vugar-Naib

    Joined:
    Aug 28, 2015
    Posts:
    8
    Actually we not should get SpriteRenderer>().color data. We should get the image pixels RGB channel data for subsequent modification! And the main question is whether it is possible in C#???
     
  5. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
  6. Vugar-Naib

    Vugar-Naib

    Joined:
    Aug 28, 2015
    Posts:
    8
    I looked at the video tutorials on this link, but it unfortunately does not have a solution my question.
    Any ideas on this subject?
    Thank you in advance!
     
  7. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    It is possible to get and set the pixels of a Texture2D asset in Unity via scripting. See the API in http://docs.unity3d.com/ScriptReference/Texture2D.html

    There is a lot of color grading tools available in Asset Store. Unfortunately it seems that most of them are meant for real-time grading and not to bake results for a single texture/atlas offline. Some info here http://blogs.unity3d.com/2015/05/12/color-grading-with-unity-and-the-asset-store/

    It is pretty easy to open an image into 3rd party editor like Photoshop and tweak the colors. After saving, the texture in Unity editor automatically reimports and you can immediately see the results.
     
  8. Vugar-Naib

    Vugar-Naib

    Joined:
    Aug 28, 2015
    Posts:
    8
    Thank you Keely! Really useful links. I hope this will help our programmer.
    Yes, this option is also considered. And on this subject I will create a new topic!