Page 2 of 2 FirstFirst 12
Results 21 to 39 of 39
  1. #21
    ok let me till this night
    will make a new version
    sorry never really look at this bug for color
    have a lot of old 2.49 files but I always add my own cycles mat !
    so no color problems !



    happy bl
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  2. #22
    here is new version which changes all material diffuse color on selected objects

    test it and let me know if OK!

    RGB-Linear4.blend

    2 buttons version

    RGB-Linear5.blend


    happy bl
    Last edited by RickyBlender; 22-Jan-15 at 09:34.
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  3. #23
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    AWESOME !!

    srgb to linear works just fine, I can import any srgb model and convert it to linear values !
    unfortunately linear to srgb seems to have some problems, it doesn't convert well

    test it yourself with the dark red value

    dark red srgb = 0.5,0,0
    dark red linear = 0.214,0,0

    so if you convert 0.5,0,0 from srgb to linear you get 0.214,0,0 that is right
    while if you convert 0.214,0,0 from linear to srgb you get 0.95,0,0 that is wrong since you should get 0.5,0,0

    may be you didn't code correctly the math in python ..

    /* LINEAR TO SRGB
    /* this assumes red,green,blue values from 0 to 1
    /* and convert linear red to srgb red
    /* you need to do the same for green and blue
    L = red
    if L <= 0.0031308 then S = L*12.92 else S = 1.055*(L^(1/2.4))-0.055
    red = S

    the order of evaluation is important:
    you first need to do 1/2.4 that is about 0.4166
    then power 0.214 (L) by 0.4166 that is about 0.5260
    then multiply 0.5260 by 1.055 that is about 0.5549
    then subtract 0.055 from 0.5549 that is about 0.5



  4. #24
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    I gave a look at your python code and I found the bug, you should rewrite the lin2s1 function as follows:


    def lin2s1(x):

    a = 0.055
    if x <=0.0031308:
    y = x * 12.92
    elif 0.0031308 < x <= 1 :
    y = 1.055*(x**(1.0/2.4)) - 0.055

    return y


    this way it works fine



  5. #25
    nice catch
    did u correct it

    I already replace the version 3 with a new one anyway


    so does seems to work as expected
    show us some test so people can see the difference !


    thanks
    happy bl
    Last edited by RickyBlender; 21-Jan-15 at 17:09.
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  6. #26
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    WELL DONE !! It works perfect !

    One minor bug is that it converts the whole scene instead of the selected object only. But this is easy to work around just loading a single object at a time to convert it.

    Also, if you would accept a suggestion, to me the script interface seems over complicated. Just having two buttons "srgb to linear" and "linear to srgb" would do the job.

    Anyway, now your script works perfect and it is usable for production !!

    The attached image shows the difference between linear and srgb colors. Linear colors are much darker than srgb.

    So if you import a srgb model in the scene (blend 2.4x,dae,fbx,obj,3ds etc), Blender reads it as linear and the colors appear much brighter than in the original model.

    Now using your script the user can convert between srgb and linear so to fix the Blender behaviour when needed.

    To import from srgb format (blend 2.4x,dae,fbx,obj,3ds etc)
    - turn off CM by setting display device to none
    - import the srgb model
    - run the srgb_to_linear script
    - turn on CM by setting display device to srgb

    To export to srgb format (blend 2.4x,dae,fbx,obj,3ds etc)
    - turn off CM
    - run the linear_to_srgb script
    - export the model

    Beware, this applies to Blender 2.5x-2.73 (current version at this time). The Blender team said that they will add CM capabilities to i/o scripts in a future release (see https://developer.blender.org/T43025). So this issue may not apply to future versions of Blender.

    Also, some external i/o scripts could already handle the srgb-linear conversion so you have to check out before exporting. Anyway, you have the script if you need it.


    bye, Alessandro

    srgb_vs_linear.jpg



  7. #27
    another thing like that I saw yesterday
    doing some model I use the color picker in the viewport on background image
    and it gets the right color I think!
    but I have to manually increase the color intensity
    is it same problem and possible to correct mat be ?

    I will look at that problem for all mat
    not certain I thought it did only on the selected ob !

    thanks
    happy bl
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  8. #28
    corrected and made new version #4
    I made certain that mat change now is only for the selected ob !

    check it out let me know if all OK!

    also made a 2 buttons version
    try it and let me know what you think?
    see post #22

    happy bl
    Last edited by RickyBlender; 22-Jan-15 at 09:35.
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  9. #29
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    I tested the color picker with textures and as far as I can see there isn't any issue with it. It correctly converts srgb texture values to linear values.

    To see the real colors (no lights and shadows) you have to set the shading to shadeless. I used a shadeless sphere as object to test the picker.

    Also, to see the srgb value, you need to access the HSV or HEX tabs of the color panel. This is because the RGB tab shows linear values, while the HSV and HEX tabs show the dispay space values (srgb when display device is set to srgb).

    This behaviour may be confusing for the user and indeed it is. I already pointed out this issue in my post to the blender team (see https://developer.blender.org/T43025) and they say they will update the color picker to allow the user choose the color space for all tabs. This will happen in a future release though, together with i/o scripts CM.

    Anyway, your new two button script works just fine ! It only converts selected objects and it is very easy to use. I tested it and I didn't find any bug at all.

    GREAT JOB

    picker.jpg



  10. #30
    color picker

    do you mean it will pick right color if I use HSV then RBG ?

    ZC1.JPG

    HSV at least looks brighter!



    thanks
    Last edited by RickyBlender; 22-Jan-15 at 15:17.
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  11. #31
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    If you don't mind I need the blend file to check it so I can give you a correct answer.

    From what I see in the picture may be you simply didn't pick the two colors from the same texture pixel. Since the texture is a photo of course there are slight variations of colors depending on the pixel you pick up. Also, the two cubes you use to compare the colors must be shadeless to correctly evaluate the picker. Anyway this is only a guess, if you can post the scene I can look at it better.


    bye, Alessandro

    p.s. I attached my scene I used above for picker testing. It uses a shadeless sphere (to avoid lighting variations) and a bmp image (to avoid jpg color variations). You can use it to test the picker the correct way. When loading the scene be sure to check the "scene interface" option so to have everything at its place as intended.

    picker.blend
    Last edited by padone; 23-Jan-15 at 00:18.



  12. #32
    yesterday I got 2.73a
    and looks like the color test I did does not work anymore!
    anyway this is a small detail and don't use it often!

    as long as script works well
    that was the main goal !

    happy bl
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  13. #33
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    2.73a is amazing

    If it may help, you can use my scene above picker.bend for testing. I'm quite sure the color picker works fine though.

    I would add that your script could be very useful even for paint artists used to Painter or Photoshop. Because it allows to assign plain srgb colors to the 3d model out of the CM, then convert the colors to linear for rendering.

    The color space used by Painter, Photoshop and any paint application around is srgb. So paint artists are used to the srgb color space. Linear colors don't make sense for them because it is a color space they don't know.

    Unfortunately at this time (Blender 2.73a) there is no way for a paint artist to input RGB values in srgb space inside the CM. This is because the RGB tab of the color panel only accepts linear values. So in Blender it doesn't exist a RGB input for red,green,blu values in srgb space.

    So finally your script is essential for two very important tasks:

    - import/export 3d formats that use srgb colors (blend 2.4x,dae,fbx,obj,3ds etc)
    - allow paint artists to assign RGB values in the traditional srgb color space they are used to


    p.s. marked as [SOLVED]
    p.p.s. I reported your script to the Blender team https://developer.blender.org/T43025
    Last edited by padone; 24-Jan-15 at 19:57.



  14. #34
    Originally Posted by padone View Post
    2.73a is amazing
    I would add that your script could be very useful even for paint artists used to Painter or Photoshop.
    Except there are a number of issues.

    I would encourage anyone scripting to leverage the OCIO calls to perform the transfer curve forward / reverse transfos for sRGB, not roll their own via a formula.

    Second, it should be made clear that sRGB is more than just a transfer curve, but also a set of primaries.

    Needless to say, isolating any color transform outside of a color management system will end up causing more problems than it seeks to solve.



  15. #35
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    @troy_s
    I totally agree with you 100% on everything you said.

    Indeed, this script was fast coded by RickyBlender to be used as a workaround until the Blender team "fixes" the CM.

    I say "fixes" in quotes because it is not an issue in the CM code itself, but it is rather an issue in the i/o scripts that are not CM aware (unfortunately including blend 2.4x i/o and dae/fbx i/o).

    @everyone
    Anyway, the Blender team is aware of this and seems it is going to fix it in a next release. See https://developer.blender.org/T43025

    from Antony Riakiotakis (Color Picker coder):
    "The problem is to allow users to specify if material color values in assets are to be converted into linear. As @brecht said and @sergey explained this will not fix lighting, but at least some artists should be able to get something close to the original color."

    "I will also try to improve the color pickers so users can choose the space where things are displayed."

    from Sergey Sharybin (Color Management coder):
    "The plan here i think would be to add some utility function in bpy so importers/exporters might do color conversion if they want. But such conversion on io shouldn't be something what belongs to core (meaning individual io scripts will deal with this)."

    @forum moderators
    If it is agreed by the forum moderators, it would be useful to make this thread sticky. Both to make the beginner artist aware of the issue, and to make the workaround more visible and available to the community. As actually this script is the only way to "fix" things up.
    Last edited by padone; 25-Jan-15 at 04:39.



  16. #36
    @ Padone
    to have this as a sticky you should contact the moderator team
    and mat be add sticky to material and texture forum!

    also it looks like there many more color scheme that exist
    look at wiki for RBG
    don't know if there are equations for the other color scheme
    would be possible to add these to the script !

    any idea when they are going to correct this ?
    I mean very soon or in 6 months ?

    there is this site here
    different color palette formulas
    http://www.brucelindbloom.com/index....YZ_Matrix.html

    I could make a new algo for these if it is worth it !






    happy bl
    Last edited by RickyBlender; 25-Jan-15 at 10:43.
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  17. #37
    Originally Posted by RickyBlender View Post
    also it looks like there many more color scheme that exist
    look at wiki for RBG
    don't know if there are equations for the other color scheme
    would be possible to add these to the script !

    I could make a new algo for these if it is worth it !
    I will restate again, as apparently I wasn't clear.

    This is the wrong approach. Not just slightly wrong, but completely.

    To perform a correct color conversion, a script must be absolutely certain of the correct input space and output space. OCIO tracks these assumptions, and controls the reference space.

    The only method to correctly achieve a color transform is within the context of the color management system.

    So, in order to correctly perform these actions withing Blender, for example, you must use the OCIO calls, as opposed to formulas for transfer.

    Even if one is outside of Blender, it is still vastly wiser to use OCIO.



  18. #38
    don't know if it can be done with script !

    cannot find much on this OCIO thing
    any good link on this ?

    i know there is always the question of the Color Temperature of the screen
    to be taken into account which depends on the Screen monitor you have too!





    hopefully this will be taken care soon by Dev's

    happy bl
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  19. #39
    Member
    Join Date
    Mar 2014
    Location
    Italy
    Posts
    49
    I agree with Troy.

    The right approach is to let Blender developers fix the issue using OCIO and fixing i/o scripts. The sRGB script was needed to have a workaround until the issue is fixed. But it doesn't make sense to expand it anymore, since it would become something that goes its own way even conflicting with the CM itself.

    Finally, I have no idea when the Bender team will find the time to work on this. I guess they have many more things to do too. This is why the sRGB script is a very needed workaround while we wait. And Ricky did an excellent and very fast job on it


    p.s. Reported to moderators for sticky. But of course is their own choice as it is fair to be. I agree material forum would be more appropriate.
    Last edited by padone; 25-Jan-15 at 11:41.



Page 2 of 2 FirstFirst 12

Posting Permissions

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