sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Texture Resizer (1.5.6) — updated 15.05.2013

    Scheduled Pinned Locked Moved Plugins
    104 Posts 35 Posters 96.9k Views 35 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Aerilius
      last edited by

      It finally looks really great, Thanks for all your help!
      It's probably time to make a real Ruby Webdialog toolkit so that webdialogs don't look anymore like websites, but like native OS dialogs.

      @driven said:

      I did have one projected texture that needed re-positioning.

      I have no idea what could cause this. The plugin doesn't touch UV coordinates but just replaces the texture images. Since SketchUp changes the aspect ratio and scale after re-importing, the plugin has to override it again with the old scale (it should work, but maybe there is a problem). Can you give me a link to the Velux model, then I can have a look tomorrow?

      1 Reply Last reply Reply Quote 0
      • L Offline
        Lersince1991
        last edited by

        Hi,

        Great plug-in but I'm having serious problems.

        When I apply any changes no matter what settings are ticked, it messes with all the colours really badly, haven't got a clue why its doing this?

        I've attached 2 thumbnails of before and after.
        cheers
        Luke

        edit; just updated to the latest version but its not working? attached another screenshot below of the blank window i get


        Screen Shot 2011-11-19 at 10.43.01.png


        Screen Shot 2011-11-19 at 10.43.35.png


        Screen Shot 2011-11-19 at 11.03.30.png

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by

          Sorry Luke,
          the blank screen, thats the missing "S", I referred to..
          the "TextureResizerOptions.htm" file needs the 's' added to it's name,
          [in Finder, select file >> then return >> then right arrow >> add the [s] >> click out.]

          Luke, what format are the texture files?

          Also, I always use Goldilocks first to get an overview at the screen size I think people should view at, then select and reduce.

          john

          @Aerilus, the windows surround curved sides, complete 'slide' shows the problem http://sketchup.google.com/3dwarehouse/cldetails?mid=b74580f8fed2b7691ae371d97b34cb90

          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          1 Reply Last reply Reply Quote 0
          • L Offline
            Lersince1991
            last edited by

            awesome all works now I updated to the new version and changed the file name!

            1 Reply Last reply Reply Quote 0
            • L Offline
              Lersince1991
              last edited by

              I have a suggestion:

              Could you have an option to stop it from upscaling images when using the px/m option please?
              Nothing is gained but its cancelling out the point of downscaling the images. i.e. some images go down in size reducing the file size, but some image then get upscaled increasing file size and your back to where you started.

              This would be massively beneficial and allow me to get the best file size / quality.

              Luke

              1 Reply Last reply Reply Quote 0
              • D Offline
                driven
                last edited by

                @lersince1991 said:

                some images go down in size reducing the file size, but some image then get upscaled increasing file size and your back to where you started.
                Luke

                Maybe you tried this...
                If you preselect 'ALL' then deselect the ones you want 'untouched' then open 'TR' it's in a different mode, that only adjusts the selection...
                john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Aerilius
                  last edited by

                  @lersince1991 said:

                  When I apply any changes no matter what settings are ticked, it messes with all the colours really badly, haven't got a clue why its doing this?

                  Do you still have this issue?
                  I also had a serious problem with colors: In the materials dialog, SketchUp offers two options, either to change a color tone or alternatively to completely colorize a texture. When I reload a texture, SketchUp resets the color tone to normal. Because of that I wanted to set the plugin to apply the previous color tone again, but due to an API bug SketchUp then sets always the colorized state. So I thought my workaround would just leave the colors how they are defined in the image file.

                  @lersince1991 said:

                  Could you have an option to stop it from upscaling images when using the px/m option please?

                  Did you have a case where it upscaled the images? The plugin should automatically skip textures that otherwise would be upscaled (if you keep the Ruby console open, it will tell you when this happens).
                  (The percent option does not have this limit, so when someone inserts 200% it obviously does upscale all.)

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    driven
                    last edited by

                    @aerilius said:

                    due to an API bug SketchUp then sets always the colorized state. So I thought my workaround would just leave the colors how they are defined in the image file.

                    Do you know if the same bug exist on mac SU, materials are handled differently [I believe], also, does your sips version work exactly the same as the IM version?

                    A request/query I have considered is, could the originals be gzipped and stored in a way that survives a standard 'purge unused' and than be optionally reinstated for high quality rendering?
                    I suppose the gzip could be external for smaller, overall file size, but would be better self contained if you just need a textured model to work on.

                    john

                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Aerilius
                      last edited by

                      @driven said:

                      Do you know if the same bug exist on mac SU, materials are handled differently [I believe], also, does your sips version work exactly the same as the IM version?
                      For this plugin, sips can do everything that my plugin does with ImageMagick.

                      I have thought about somehow keeping the originals somewhere, but I wasn't sure since it is not much related to the resizing itself and it would require 2 options in the UI (export + import). Before I had come to a decision, TIG has done this awesome script:
                      TextureSwapper http://forums.sketchucation.com/viewtopic.php?p=365582#p365582

                      1 Reply Last reply Reply Quote 0
                      • brodieB Offline
                        brodie
                        last edited by

                        I'm really excited about this script, but I'm a little confused on the usage of this script as it doesn't seem to work as I assumed it would. My assumption was that you could open a model set the percentage to 100% and the max resolution to 1024 and any textures that were larger than 1024 would be downscaled to match that resolution.

                        So far as I can tell though that doesn't work on 2 accounts. 1, it looks like it only affects textures you have selected. 2, with the percentage at 100% it seems to ignore the 1024 max resolution setting and does no resampling. Instead you have to set the percentage to, say, 95% (99% didn't seem to work) for it to downsample to 1024.

                        Is this currently how it works or am I missing something? In my opinion these are limiting factors for the script as I don't always know what the resolutions of the images are and if they're already 1024 I don't want to further downsize them every time I run the script. Also, having to select all the textures opens me to the distinct possibility that I'll miss some textures which could be too large. And it takes longer of course.

                        Is there any way to universally downsize all textures larger than 1024 to that size?

                        -Brodie

                        steelblue http://www.steelbluellc.com

                        1 Reply Last reply Reply Quote 0
                        • thomthomT Offline
                          thomthom
                          last edited by

                          @unknownuser said:

                          Is there any way to universally downsize all textures larger than 1024 to that size?

                          Haven't tried the plugin, but looking at the screenshot in the description I noticed this:
                          max-res.png

                          Thomas Thomassen — SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 Reply Last reply Reply Quote 0
                          • brodieB Offline
                            brodie
                            last edited by

                            Right T, that's what I was using. I set the resize percentage to 100% and set that Max Resolution to 1024px assuming that if it found a texture that was 1024px or smaller, it wouldn't resize it down any further but if it found a texture that was 1025 or larger it would downsize it accordingly.

                            Using it on a texture that was 3000x2000 though provided no change until I set the percentage from 100% to 95%. Not if I run the script again on that texture it will be reduced further. I suppose though that I could set the minimum size to 1024 in order to eliminate that but then I presume it would upsize a 500x500px image to 1024x1024 which isn't what I'd want.

                            -Brodie

                            steelblue http://www.steelbluellc.com

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              driven
                              last edited by

                              @unknownuser said:

                              Also, having to select all the textures opens me to the distinct possibility that I'll miss some textures which could be too large. And it takes longer of course.

                              Is there any way to universally downsize all textures larger than 1024 to that size?

                              -Brodie

                              the Dialog Title is either "Resize textures in model" or "Resize textures in selection" depending on what is/isn't selected before opening the ruby.

                              It needs to be "Resize textures in model" to 'do' all at once, i.e. select nothing before opening the ruby.

                              I mostly use the 'goldilocks' feature 'to cap all' as it only pulls down to the setting.

                              the script is really well commented

                              but, you might try setting Percentage above 100%, with 'Limit Texture Size' max 1024px

                              john

                              learn from the mistakes of others, you may not live long enough to make them all yourself...

                              1 Reply Last reply Reply Quote 0
                              • A Offline
                                Aerilius
                                last edited by

                                **@unknownuser said:

                                Using it on a texture that was 3000x2000 though provided no change until I set the percentage from 100% to 95%. Not if I run the script again on that texture it will be reduced further. I suppose though that I could set the minimum size to 1024 in order to eliminate that but then I presume it would upsize a 500x500px image to 1024x1024 which isn't what I'd want.**
                                I think I have an idea what the problem is. I had set an internal criterium that textures are skipped if their new size differs only 2% (to avoid unnecessary re-encoding and quality loss). Of course that should not happen in this case.

                                I also had thought about unwanted upscaling: It should not upscale textures except if the user intentionally sets a percent > 100%.
                                I will check these criteria again and fix the above problem!

                                1 Reply Last reply Reply Quote 0
                                • brodieB Offline
                                  brodie
                                  last edited by

                                  @driven said:

                                  @unknownuser said:

                                  Also, having to select all the textures opens me to the distinct possibility that I'll miss some textures which could be too large. And it takes longer of course.

                                  Is there any way to universally downsize all textures larger than 1024 to that size?

                                  -Brodie

                                  the Dialog Title is either "Resize textures in model" or "Resize textures in selection" depending on what is/isn't selected before opening the ruby.

                                  It needs to be "Resize textures in model" to 'do' all at once, i.e. select nothing before opening the ruby.

                                  I mostly use the 'goldilocks' feature 'to cap all' as it only pulls down to the setting.

                                  the script is really well commented

                                  but, you might try setting Percentage above 100%, with 'Limit Texture Size' max 1024px

                                  john

                                  Thanks, you're right. I guess My problem was with trying to test both things at once. I must have only tried 100% every time I had nothing selected so it wasn't doing anything. Thanks.

                                  After a brief look at goldilocks it looked like it resampled according to where your view was at. Are you saying you can use it to cap all textures at, say, 1024px?

                                  -Brodie

                                  steelblue http://www.steelbluellc.com

                                  1 Reply Last reply Reply Quote 0
                                  • brodieB Offline
                                    brodie
                                    last edited by

                                    @aerilius said:

                                    **> @unknownuser said:

                                    Using it on a texture that was 3000x2000 though provided no change until I set the percentage from 100% to 95%. Not if I run the script again on that texture it will be reduced further. I suppose though that I could set the minimum size to 1024 in order to eliminate that but then I presume it would upsize a 500x500px image to 1024x1024 which isn't what I'd want.
                                    **
                                    I think I have an idea what the problem is. I had set an internal criterium that textures are skipped if their new size differs only 2% (to avoid unnecessary re-encoding and quality loss). Of course that should not happen in this case.

                                    I also had thought about unwanted upscaling: It should not upscale textures except if the user intentionally sets a percent > 100%.
                                    I will check these criteria again and fix the above problem!

                                    It looks like if I have nothing selected and run the script at 95% with max res at 1024 and min res at 1024 it gets me pretty close to what I'm looking for. The only caveat is that for a non-square image is samples it such that the smaller dimension is 1024.

                                    I can't think of how to do what I want in a truly intuitive way and maintain all the other features you have here. Perhaps you could consider writing a similar script which trims down the features and only asks you for a Max Resolution for all the textures in the model. I'd use that almost as often as purge or cleanup. Might be something to consider if you think others would use that as well. Just a thought. Regardless, I'm really glad you wrote this script. It's amazingly fast and hugely useful!

                                    -Brodie

                                    steelblue http://www.steelbluellc.com

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      driven
                                      last edited by

                                      @unknownuser said:

                                      After a brief look at goldilocks it looked like it resampled according to where your view was at. Are you saying you can use it to cap all textures at, say, 1024px?

                                      Goldilocks is view based but the image dimension it reports aren't.

                                      so if you check what it's reporting, before and after using this, you can see what is being effected by which settings.

                                      e.g.
                                      run goldilocks.rb >> find the highest dimension.
                                      run TextureResizer.rb >> set Percentage @ 100% + set Max Size to something lower than what you saw >> apply
                                      run goldilocks.rb >> it shows what has been capped...

                                      I just found it useful to see what was happening.

                                      [for most my stuff, I use the actual Goldilocks Method in TextureResizer as well, but you don't need to.]

                                      john

                                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                                      1 Reply Last reply Reply Quote 0
                                      • A Offline
                                        Aerilius
                                        last edited by

                                        @driven said:

                                        I did have one projected texture that needed re-positioning.

                                        I fixed the problem with the Velux windows: The script did not correctly calculate wrong texture resolution on projected textures and scaled the texture to a too small size.

                                        @unknownuser said:

                                        Perhaps you could consider writing a similar script which trims down the features and only asks you for a Max Resolution for all the textures in the model.

                                        I fixed the problem that it skips textures when only limit is set and percentage 100%. I think it's not necessary to create a separate version, instead I added that it remembers your settings from one session to the next. I hope that makes it more comfortable!

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          driven
                                          last edited by

                                          hi
                                          on a test file that was working, I'm now getting 2868575561_07cdee7361_z1#1: could not write file /var/folders/lN/..removed../-Tmp-/skp_tr95419/2868575561_07cdee7361_z1 ?
                                          the file name is showing as the material name in Goldilocks, but that worked earlier with the other script.
                                          If I rename it now TR runs fine.

                                          and the -TMP- directories are accumulating [testing 'as is' without my patch]

                                          keep on keeping on
                                          john

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                                          1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            samothrace41
                                            last edited by

                                            Thank you so much Aerilius, for the plugin "image resizer".
                                            Sylvie (Cathy Tritschler's pupil)

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 2 / 6
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement