Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

► Resize Pro ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, May 3, 2016.

  1. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    93
    It doesn't throw any errors, just ends up with an empty image, yet with Gamma lighting, it works fine.
     
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Did you include Assets\VacuumShaders\Resize Pro\Shaders\BlitCopy.shader to the build?



    VacuumShaders - Facebook Twitter YouTube
     
  3. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    93
    My mistake... I hadn't specified the last parameter which tells it that it's Linear.
    TextureResizePro.ResizePro(photoTaken, 720, 1280, false, true);
     
  4. Maarten_AryzonTeam

    Maarten_AryzonTeam

    Joined:
    Sep 29, 2016
    Posts:
    12
    Hi,

    I'm trying to get your plugin to work on iOS and I think I have tried every option though nothing seems to work. I'm getting the same result as when I hadn't added the BlitCopy shader to the graphics settings in the Editor play mode: a dark grey / black texture. It works perfectly fine in the editor in play mode. I added it to the graphics settings and even tried including it in a material on an object in the scene to make sure it would build the shader.

    I tried both resize methods, direct resize and with the 'out' parameter. I tried setting the linear to true as well, didn't work either, though I'm thinking this should not give a black texture anyway.

    I'm using Unity 2018.2.0f2 on iOS 11.3 / 11.4, using Metal and running with ARKit
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    iOS has limit on texture resolution to 4k and as a result Unity will fail to work with such textures, ResizePro as well.



    VacuumShaders - Facebook Twitter YouTube
     
    theolagendijk likes this.
  6. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    104
    Hi @kachelaar ,

    are you working with image files larger then the iOS texture limit of 4k? If so, first use a native iOS plugin to do the image resizing ( <= 4k ) and then apply the image file as a texture.
     
    Arkhivrag likes this.
  7. Maarten_AryzonTeam

    Maarten_AryzonTeam

    Joined:
    Sep 29, 2016
    Posts:
    12
    Thanks for your response. I didn't know that but I don't think that's the problem. I'm loading files from disk which do work when I'm not using the plugin. Once I use the plugin the object renders black. I wrote a native plugin though I would like to keep it cross platform for easier maintenance.
     
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    ResizePro has two methods for image resizing, first one will fail if texture is not marked Read/Write Enabled inside TextureImporter or is not in RGBA32 format. Use the second method, it accepts all type of textures.



    VacuumShaders - Facebook Twitter YouTube
     
  9. Maarten_AryzonTeam

    Maarten_AryzonTeam

    Joined:
    Sep 29, 2016
    Posts:
    12
    Like I said earlier I tried both methods. I'm currently using a native resizing implementation so it's not a big issue. Perhaps it's something in the way Unity handles shaders since 2018.2. Is there anything else I can try? Else I will leave it for now.
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Does it work with normal textures.
    In normal texture I mean textures that are initially inside project/build and do not go through any resize or generate plugin. Problem may be in those plugins not saving texture correctly.
    I have just tested with Unity 2018.2.5 and everything works at my side.
    If still have problem contact me: vacuumshaders@gmail.com



    VacuumShaders - Facebook Twitter YouTube
     
  11. darinama

    darinama

    Joined:
    Aug 22, 2018
    Posts:
    1
    Hi, I've sent you an email with some questions =)
     
  12. MohamedMoghazi

    MohamedMoghazi

    Joined:
    May 12, 2015
    Posts:
    1
    Would you please share an example with www load image and resize, I can only get black empty image return ?

    Thanks
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Code from Unity documentation:
    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6.  
    7. using VacuumShaders.TextureExtensions;
    8.  
    9. public class NewBehaviourScript : MonoBehaviour {
    10.  
    11.     public string url = "https://docs.unity3d.com/uploads/Main/ShadowIntro.png";
    12.     public Texture2D newT = null;
    13.  
    14.     IEnumerator Start()
    15.     {
    16.         Texture2D tex;
    17.         tex = new Texture2D(4, 4, TextureFormat.DXT1, false);
    18.         using (WWW www = new WWW(url))
    19.         {
    20.             yield return www;
    21.             www.LoadImageIntoTexture(tex);
    22.  
    23.             tex.ResizePro(32, 32, out newT);
    24.  
    25.             GetComponent<Renderer>().material.mainTexture = newT;
    26.         }
    27.     }
    28. }
    29.  
    30.  
    Tested on PC and Android. Everything works.
    Note, on Monday there will be update to fix some texture resize problem on iOS, may be it will help you too.



    VacuumShaders - Facebook Twitter YouTube
     
  14. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    130
    Hello Arkhivrag,
    As MohamedMoghazi, there is a black texture on IOS when using ResizePro.
    I noticed that it's working correctly with an Iphone 5, but from Iphone 6, it returns a black texture which is really annoying for my project which is online...
    Did you find something ?

    Thanks
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    There was a little bug on iOS that is already fixed in v2018.3
    As for www textures, I was not able to reconstruct 'black image' issue at my side.
    Are textures bigger than 4K? iOS does not work with such big textures and Unity will generate empty Texture2D object.



    VacuumShaders - Facebook Twitter YouTube
     
  16. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    130
    Hey,
    I was using your exemple "Code from Unity documentation" a few messages up for testing and the image is far below 4K.
    But I tried with the "Texture Adjustments" plugin. Is resize pro up to date with it ?
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Texture Adjustments works and ResizePro does not?
    Can you caontact me using vacuumshaders@gmail.com



    VacuumShaders - Facebook Twitter YouTube
     
  18. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    130
    Hey,
    No I mean I just tried with "Texture Adjustments" and I was wondering if it was up to date with the last ResizePro version (v2018.3) ?
    I will contact you tonight when I have my computer :)
     
  19. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi, can i check if this plugin does this:

    Width: 1000, Height: 500, the cropping results in a 500x500 image from the image centre.

    Edit: I bought your plugin and it works great. However the output when i call Resize is rotated 90 degrees to the left. Any fixes?
     
    Last edited: Oct 15, 2018
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Only resize.
    Crop and other transformations are available in Texture Adjustments plugin.







    VacuumShaders - Facebook Twitter YouTube
     
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Have never heard about such problem.
    What Unity version do you use? What is build target?
    Any kind of info to reconstruct your issue will be helpful.



    VacuumShaders - Facebook Twitter YouTube
     
  22. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    The rotation is due to the exif image information. it's sorted on our end. Thank you :)
     
  23. dogfacedesign

    dogfacedesign

    Joined:
    Jan 10, 2016
    Posts:
    70
    Hi there, just bought the asset and it works pretty well! Nice job! Quick question, though. Is there some way to have ResizePro handle the preserving of aspect ratios when downsizing? For example, I have a small 60x80 area that I am resizing images into. But it is not preserving aspect ratio, so they get stretched out.

    Also, I think the docs need to be updated. Instead of calling ResizePro(), I had to do TextureResizePro.ResizePro().

    Thanks in advance for any guidance!
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Editor tool has all possible aspect ratio controllers, but with run-rime API you control width and height manually.

    Use VacuumShaders.TextureExtensions namespace in your scripts and Texture2D class object will have ResizePro method attached.



    VacuumShaders - Facebook Twitter YouTube
     
  25. MercurialKid

    MercurialKid

    Joined:
    Aug 30, 2018
    Posts:
    21
    Hi - couple of pre sales questions, please. I've given the forum posts a cursory glance, but wanted to ask two questions.

    1.Does the ResizePro work in the latest version of 2018 Unity?
    2. I want to resize screen captures, taken from with the ScreenCapture.CaptureScreen( which I'm storing in the StreamingAssets folder in my game. These are stored as PNG. I want to load them from file during runtime, and resize and store them back to file. Will ResizePro help me with this?

    Thanks
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    1. Tested with Unity 2018.2.5f1. Works.
    2. ResizePro works with Texture2D object. If texture is loaded correctly into Unity Engine, it will be resized.



    VacuumShaders - Facebook Twitter YouTube
     
  27. AdamKane

    AdamKane

    Joined:
    Dec 3, 2012
    Posts:
    111
    Is there a non-dll version available? Moving dlls around doesn't play nicely with Unity Collaborate, so we try to avoid them when possible.
     
  28. AdamKane

    AdamKane

    Joined:
    Dec 3, 2012
    Posts:
    111
    Is there a version which doesn't require being at the asset root folder? That's incompatible with my team's project structure convention.
     
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Just submitted update v2018.4, it has no restriction for root folder.



    VacuumShaders - Facebook Twitter YouTube
     
  30. dlevel

    dlevel

    Joined:
    Mar 23, 2016
    Posts:
    259
    Hi, I would like to do a batch resize of my textures and replace the existing ones, is this something possible or I need to replace the old textures with the new ones by hand?
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    If new generated texture has the same name (mostly has), same extension (ResizePro editor tool encodes textures in PNG and JPG formats) and same location, then source texture file will be overwritten.



    VacuumShaders - Facebook Twitter YouTube
     
  32. dlevel

    dlevel

    Joined:
    Mar 23, 2016
    Posts:
    259
    ahh yeah, will just go on and do that by hand, it is mentioned about a plug in that is needed for tga, but the link doesn't redirected to a valid location, could you point me the correct one?
     
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Plugin name is Encode To TGA



    VacuumShaders - Facebook Twitter YouTube
     
  34. Luba

    Luba

    Joined:
    Oct 1, 2014
    Posts:
    24
    it has some support to do the resize directly from the bytes [] of the image.
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    Plugin works with Unity Texture2D class objects only. No byte[] resizing.



    VacuumShaders - Facebook Twitter YouTube
     
  36. Lemonua

    Lemonua

    Joined:
    Mar 16, 2017
    Posts:
    6
    Hi. Can i use this asset if i want to make two builds - one with original textures and second woth half-size texture? And how to do it properly?
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    1,995
    You can resize Texture2D objects inside editor or in run-time (with simple ResizePro method).



    VacuumShaders - Facebook Twitter YouTube