Search Unity

PSD color matte change in 2018.2

Discussion in 'Editor & General Support' started by AcidArrow, Jul 11, 2018.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    From the release notes:

    What's the motivation behind this change? It seems to me that it breaks a bunch of PSDs we use.
     
    Lars-Steenhoff, MWB and Rennan24 like this.
  2. ekaralar

    ekaralar

    Joined:
    Jan 13, 2015
    Posts:
    14
    There should be an option to go back to previous logic.
    Because of this we've moved back to 2018.1
    @Unity: Any explanation or fix?
     
  3. Rennan24

    Rennan24

    Joined:
    Jul 13, 2014
    Posts:
    38
    Yeah I just upgraded a clone of our current game and a lot of the textures have this nasty looking white sort of alpha around the edges of everything, Hopefully there's either a good reason for this or some way to revert it because it does not look very good...
     
  4. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    lifeisfunxyz likes this.
  5. bioticste

    bioticste

    Joined:
    Aug 11, 2014
    Posts:
    37
    This is really bad for my business, all our spritesheets are PSD's and we have thousands of animations using them. This is going to create weeks of work for us converting files and rebuilding scenes and animations. Since 2018.2.0f1 all my sprites look like they are glowing white and have white shadows.

    I really hope Unity go back to the way PSD white matte was imported for years or at least create an importer.
     
    Brockoala likes this.
  6. tcleavy

    tcleavy

    Joined:
    Jul 16, 2018
    Posts:
    2
    Yep this needs sorting out, Unity can't just change something that is so crucial to many development pipeline, they are taking value from their product. Here's hoping for the importer.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    I at least want an explanation for what motivated the change.

    The notes say "That means that texture colors will look exactly same as if image was "flattened" in Photoshop" but it doesn't seem to be like what's happening to me, or I'm misunderstanding it.
     
  8. bioticste

    bioticste

    Joined:
    Aug 11, 2014
    Posts:
    37
    @AcidArrow I think what they mean is the texture colours will be the same as if it was on a white background (like in photoshop when flattened). Alpha 0 will still be transparent and alpha 1 the original colour but all other alpha values will be the same as having the image with a white background behind it. I too would love to know why they have changed this, it seems illogical.
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    Okay, I sort of get it, but when is that useful?

    So a pixel that was black and 50% transparent, will now become 50% gray and 50% transparent, which is useful becauseee.....
     
    mahdi_jeddi likes this.
  10. bioticste

    bioticste

    Joined:
    Aug 11, 2014
    Posts:
    37
    @AcidArrow I totally agree, can't see where it would be useful, hope they fix it.
     
  11. bioticste

    bioticste

    Joined:
    Aug 11, 2014
    Posts:
    37
  12. Rennan24

    Rennan24

    Joined:
    Jul 13, 2014
    Posts:
    38
    This article explains why there are white pixels around the edges of alpha textures as well, http://www.adriancourreges.com/blog/2017/05/09/beware-of-transparent-pixels/ It's actually pretty informative and makes it much easier to see why Unity would do this. Mind you I still want to have the option to enable the tweak that removes it especially since it would be a pain in the ass to go back and fix all the textures, but for future reference I'll make sure to keep my alpha pre-multiplied when exporting!
     
    Shaggy21 likes this.
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    Is it?
    Not removing the white matte makes the issue much worse actually, so I still don't know why Unity would do it.
     
    dadude123 likes this.
  14. agmaster

    agmaster

    Joined:
    Sep 16, 2015
    Posts:
    7
    Same here. Our UIs look ugly after we had moved our projects to 2018.2 We use psd/png 50/50 and the PNGs look normal but PSD with white matte
     
  15. edaw22

    edaw22

    Joined:
    Aug 20, 2012
    Posts:
    14
    @Unity, Please address this issue ASAP. It seems very bad form to suddenly change something that was working just fine and has such a huge impact on SO many people's projects. There is no way I have the time to convert all PSD files to PNGs and fix the white matte.

    PLEASE REVERT THIS CHANGE.
     
    agmaster likes this.
  16. agmaster

    agmaster

    Joined:
    Sep 16, 2015
    Posts:
    7
    Dear @Unity, any news about this issue?
     
  17. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    They have fixed it in the latest release, but ONLY for existing psds. If you add a new psd the toggle is not there.. So yeah, still an issue
     
  18. agmaster

    agmaster

    Joined:
    Sep 16, 2015
    Posts:
    7

    Attached Files:

    Brockoala likes this.
  19. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    That only shows for existing psds, not new ones. So not a complete fix.
     
  20. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    167
    A workaround for this is, if you have an already existing psd, you can save its settings as a preset and then load the preset again for the new psds you have. select preset.PNG
     
    Brockoala, Gua, DanielVanches and 2 others like this.
  21. villevli

    villevli

    Joined:
    Jan 19, 2016
    Posts:
    87
    Another way is to change these variables at the bottom of the .meta file next to the psd file. Just open the file in a text editor.

    pSDRemoveMatte: 1
    pSDShowRemoveMatteOption: 1
     
    Vincent454 and DanielVanches like this.
  22. villevli

    villevli

    Joined:
    Jan 19, 2016
    Posts:
    87
    Here's an AssetPostprocessor that enables the Remove Matte option for all imported psd files. Place this script in an Editor folder. However it seems that Unity may remove this option completely in the future.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4. internal class EnablePSDRemoveMatte : AssetPostprocessor
    5. {
    6.     private void OnPreprocessTexture()
    7.     {
    8.         if (assetPath.Contains(".psd"))
    9.         {
    10.             TextureImporter textureImporter = (TextureImporter)assetImporter;
    11.  
    12.             var serializedObject = new SerializedObject(textureImporter);
    13.             serializedObject.FindProperty("m_PSDRemoveMatte").boolValue = true;
    14.             serializedObject.FindProperty("m_PSDShowRemoveMatteOption").boolValue = true; // this is not needed unless you want to show the option (and warning)
    15.             serializedObject.ApplyModifiedProperties();
    16.         }
    17.     }
    18. }
    19.  
     
    Rachan, sean244, BRW_arjan and 4 others like this.
  23. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    I love how we need to hack unitys own hack to get their old system back in
     
  24. Keenao

    Keenao

    Joined:
    Apr 5, 2014
    Posts:
    4
    Hi,

    I see this thread has way too few exposure. So I logged in to insist that this Unity behavior can't stay. It's simply impossible.

    How are we supposed to make RGBA: 1, 1, 1, 0.5 from a PSD now?
    That doesn't make me smile.... At all.

    Regards.
     
  25. Rennan24

    Rennan24

    Joined:
    Jul 13, 2014
    Posts:
    38
    It looks like in the warning it states that the matte removal is deprecated so I assume Unity is going to completely remove the feature at some point, Hopefully they have some sort of workaround other than exporting the PSD's to PNG's because that just adds another step in the iteration process which can be pretty annoying... Please Unity Team I just want to know why this feature was deprecated, I'm not even asking for it to be brought back I just want to know why! :confused:
     
  26. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    Here are some actions to fix psds.

    You will need to download the free plugins from:
    http://flamingpear.com/free-trials.html#freebies
    1. Put "Solidify C-150" in your photoshop plugin folder.
    2. Import the action file from the zip into photoshop.
    To use it, select the top layer in your psd, run the "Alpha -> Stamp" action. If you have any custom alpha channels or masks, make sure the generated "Alpha" channel is top in the list ( In the channels tab )

    To undo it just run the RemoveStamp action.

    This will ensure it looks identical when imported into Unity with the new system.
     

    Attached Files:

  27. SevenPointRed

    SevenPointRed

    Joined:
    Feb 3, 2016
    Posts:
    218
    I would really like to see a response from Unity on why they have done this though, there seems to be no good reason when it was working fine.
     
    Vincent454 likes this.
  28. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
    I'd also like to know what was the rationale behind this change. It only makes our work harder by breaking something that was working perfectly.
     
    Vincent454 and agmaster like this.
  29. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    167
    Totally agree, they cant just change a major thing like this for no reason
     
  30. ekaralar

    ekaralar

    Joined:
    Jan 13, 2015
    Posts:
    14
    @Unity: Any explanation please?
     
  31. Havokki

    Havokki

    Joined:
    Jun 28, 2015
    Posts:
    118
    Shameless bump. We also noticed this issue now when we updated Unity. We would like to know why such a good feature was intentionally broken and whether the option to keep the old functionality will be removed in the future?
     
    Last edited: Sep 11, 2018
  32. tobiascook

    tobiascook

    Joined:
    Aug 29, 2017
    Posts:
    4
    Yep, chiming in also to say I'm frustrated to see this happen. I can see how there's merit to doing it 'properly' as part of the export process, but for those of us who have been working for an extended period on projects with the fix doing the job for us, removing it just seems unnecessary and a bit callous. Having just upgraded across the company this is an unpleasant surprise. I'd really hope to see Unity re-instate the Remove Matte (PSD) option permanently for all PSDs.
     
  33. luislodosm

    luislodosm

    Joined:
    Apr 26, 2016
    Posts:
    26
    mahdi_jeddi and agmaster like this.
  34. ekaralar

    ekaralar

    Joined:
    Jan 13, 2015
    Posts:
    14
    @Unity: Thanks Unity, really, for making a very simple workflow as hard as possible for an unknown reason.
    And noone from the unity team care enough to explain the logic and justification behind this change.
     
    DanielVanches and agmaster like this.
  35. agmaster

    agmaster

    Joined:
    Sep 16, 2015
    Posts:
    7
    Dear @Unity team! Do you understand that the development of the GUI is complex process and, most importantly, iterative! In some cases, the layers can be turned on/off to see how it would look in the build. And this case may be used in different stages of development.

    Right now you offer to store the source of every PSD file separately and export to PNG every change.
     
  36. Erikoinen

    Erikoinen

    Joined:
    Nov 10, 2014
    Posts:
    68
    This is one of those things that make me not update Unity until there is a valid alternative, which needs to be as easy as previously.

    Right now I went with @villevli 's answer which is quite quick to do, so thanks for that!
     
  37. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    246
    I just made a bug report and got rejected. They're basically saying that we shouldn't use PSDs which doesn't make any sense. How is this different for unity than using PNGs? I used to have a PSD plugin to import them, and as far as I know, PSD layers have all of the image data needed. How semi-transparent pixels lose their color to gray in the process?

    For now I just made a AssetPostprocessor that kinda does what that plugin would do in the Photoshop, because doing all that for tens of thousands of sprites for us is just way too much work. But this isn't perfect because the color info is already lost after unity imports them.
     
    Vincent454 likes this.
  38. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    246
    By the way this is the workflow for fixing the problems in generating mip-maps for textures with transparency. We use this for the foliage and other transparent textures to fix the edge colors in subsequent mip levels. This is NOT for 2D workflow as you usually don't need mip-mapping in 2D games:
    https://docs.unity3d.com/Manual/HOWTO-alphamaps.html
     
  39. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Ok hear me out guys,
    I'm not too familiar with the importer pipeline/scripting stuff, but I imagine that there should be a way to do this automatically.

    I assumed that when unity "imports" any kind of resource they're already converting it to some internal format, no?
    Can't we just hook into the point where unity reads the source file and modify it there?
    Or is there only a callback when its already too late? (If so, what's the point then?)

    Dilating/expanding the color regions is a relatively simple operation. It should be pretty easy to do in C#.

    I'll do a little research to see if it is possible to somehow hook into that.
    For now we have the checkbox, but it is already accompanied by the "deprecated" warning thing.

    That being said, I still do not understand why they would remove that feature at all.
    Can anymore chime in and explain the motivation behind it?
    I guess @LeonhardP is the one to ask?
     
  40. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Alright here are my findings:

    1) "ScriptedImporter" ( https://docs.unity3d.com/Manual/ScriptedImporters.html )
    Sounds like exactly what we need, however:



    Wow, so that's really bad.
    Instead of simply letting the importer decide on a per-asset basis (by having a function that just returns true/false), it's simply not supported :(


    2) "AssetPostprocessor" ( https://docs.unity3d.com/ScriptReference/AssetPostprocessor.html )
    Maybe useful, however postprocessors (as the name implies) are called when the asset is already imported. Meaning it's too late, the image is already screwed up.


    All in all this really complicates the workflow with PSDs a lot.
    Obviously a lot of people are using PSDs for a non-destructive workflow. Saving as PNG loses layers and everything, so it doesn't make any sense to me.
     
    DanielVanches, agmaster, MWB and 2 others like this.
  41. AurochChris

    AurochChris

    Joined:
    Jan 7, 2014
    Posts:
    24
    I want to bump this issue because the removal of automatic matting for transparent .PSD files is hugely detrimental to our team's workflow, and I've love to see a response from Unity.

    First of, the removal of the automatic matting feature itself baffling. There's no explanation about why this is beneficial for us, or why it's necessary for the health of the engine.The feature was working perfectly in 99.5% of the cases. Occasionally it would fail to matte a .PSD, but it was easy to work around. Hopefully, this wasn't the reason to remove this.

    If I had to guess, it's probably about encouraging a specific workflow for 3D artists and not wanting to provide support when they do it wrong. I doubt Unity is aware this impacts our work as UI artists.

    Our UI's consist of 100's of sprites. During a typical 18-24 month production, we'll tweak most sprites many times to achieve the visual quality we're happy with, working in-engine to assess the changes. (We make most of these changes in engine because of the various UI features such as sliced / tiled sprites. It's just all-round better to do this in-engine than in Photoshop)

    Most of these tweaks are small and iterative - double-click the PSD, change a colour, adjust a shape, hit save, check the result, and repeat. I can decide to change something and see it in engine in 10 seconds flat, especially if I change the same file over and over.

    Removing automatic matting means an addition of 15 to 45 seconds every time I want to change something. This is the best case scenario, which requires me to automate my actions and keep my .PSD files and source folder structures organised in very specific ways, which aren't necessarily beneficial for the project as a whole. Not only do I lose a lot of time during the course of production, it also makes working with UGUI plain annoying.

    Just to be sure, I went back and tested the image quality of both an auto-matted .PSD and a manually alpha-matted .TGA file on several different sprites. (One example is attached) Aside from a 1 or 2-point difference in Hue for some transparent green colours, I can't see anything that worries me as an artist. That measured difference is imperceptible to the average player, and is going to be insignificant when you consider the variance in display quality players use.

    Maybe there's another reason to remove the feature. I'd love for Unity to provide reasons if I have overlooked something, which is certainly possible. But it's disappointing to be told that "you shouldn't be using .PSD's anyway", when our team has successfully shipped UI-heavy games with this workflow with no complaints. It makes me want to use Unity less, which is not good for anyone.
     

    Attached Files:

  42. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    246
    I started exporting .PNGs for everything and feel the pain of having to keep a separate PSD file for each one of them, and if I forget to keep them, I have to start over. It's a huge downgrade in terms of productivity.

    And the sad thing is that we can't even write our own importers because as mentioned above ScriptedImporter doesn't let you handle known file types like PSDs.
     
    agmaster likes this.
  43. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Why was it even removed in the first place?
    It's so much more work to prepare a psd with many layers and transparency to be used after this 'fix'.
    Please, Unity, if anything provide a better workaround than the one proposed in the manual.
     
    Sailendu and agmaster like this.
  44. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
    At least for now, @villevli 's solution still works in 2018.3.

    Import any PSD and edit it's .meta file with:
    pSDRemoveMatte: 1
    pSDShowRemoveMatteOption: 1​

    After that, create a Preset from it and apply it to any new PSD you import.

    It's a real life saver and has little impact on the workflow, since any change you make to the PSD will keep the settings.
    Still, this is something we shouldn't be doing at all. :(

    It would be nice to have someone from Unity with whom to chat about this obscure change. To me it seems that this decision was made from an "engineer" point of view who is used to work with TGA textures but doesn't have an understanding of the workflow with PSDs for UI.
     
  45. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    It's really a very bad decision to remove this feature, it was working nicely. Please bring this feature back. It is an essential feature.
     
  46. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    True
     
    Sailendu likes this.
  47. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    I don't know, maybe they have a reason. I mean they must have a reason.

    I just don't understand why no one from Unity will chime in this thread offering some sort of reasoning.
     
    Sailendu likes this.
  48. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    That's true, they really need to provide us a reason for this horrible downgrade. This feature is a very big requirement for any project.
     
  49. CyberStarLight

    CyberStarLight

    Joined:
    Jun 16, 2016
    Posts:
    4
    This has absolutely no up-side, it's just screwing up compatibility with photoshop, and breaks older projects. for no reason.
    Working with PNGs is fine but it doesn't allow editing complex files with layers fast like PSD source files allow us to.
    And unity doesn't care to fix it or even explain why they even did this, so annoying.
     
    Sailendu, Flavelius and Vincent454 like this.
  50. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    So clearly Unity isn't seeing this thread, can we all submit bug reports about this to get their attention ? That seems to be the only way. Hopefully one of us will have our bug report dealt with by a QA staff that is willing to get us more information.
     
    R0man, Flavelius, Sailendu and 2 others like this.