Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Conversion to TIFF? like EncodeToTIFF()

Discussion in 'Scripting' started by Nirvan, Jan 16, 2020.

  1. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    100
    I making tool to edit texture files in project and it's working.

    I have my array of pixels Color32[] setted to texture with myTexture.SetPixels32(pixels); and using them to File.WriteAllBytes(filePath, myTexture.EncodeToPNG());
    But I need possibility to do it on TIFF files.

    Maybe there is some light solution for that?

    Thanks.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,137
  3. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    100
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,137
    usually works if add that dll to your project root folder
     
    Nirvan likes this.
  5. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    100
    There are needed three dlls, WindowsBase.dll, PresentationFramework.dll and PresentationCore.dll
    and then all classes are supported in visual studio.
    But sadly I can't create palette with my pixels because System.Windows.Media.Color is spamming initialization error whenever I want to assign any value to any of its variables.

    System.TypeInitializationException: An exception was thrown by the type initializer for <Module> ---> System.InvalidProgramException: Invalid IL code in <Module>:.cctor (): IL_0032: call 0x0a00000c

    Like nothing about that online for System.Windows.Media.Color
     
    Last edited: Jan 16, 2020
unityunity