• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Deflate compression - zlib?

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 4 Posters 420 Views 4 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.
  • D Offline
    dahovey
    last edited by 2 Feb 2011, 20:24

    Hi all. I am trying to use deflate compression in a ruby plugin and not sure how to get it to work. From what I understand the best thing would be to use zlib. Along with that from what I understand zlib should be available as part of ruby development in sketchup. Also tryed 'requiring' zlib compiled version in plugin directory, but that doesn't work either.

    Anyway know how I can accomplish this?

    The ultimate thing I need to do is generate a PNG image file, being able to 'paint' each pixel. Already studied PNG documentation for what I need. That's simple enough. The compression seems to be the tough thing.

    Thanks!

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 2 Feb 2011, 20:55

      @dahovey said:

      Along with that from what I understand zlib should be available as part of ruby development in sketchup. Also tryed 'requiring' zlib compiled version in plugin directory, but that doesn't work either.

      Nope.. Google ships Sketchup with ONLY the interpreter DLL.

      You'll need to have a full Ruby install on your machine. And then push the Lib folder paths into the $LOAD_PATH array after starting Sketchup. See my !load_paths.rb script http://forums.sketchucation.com/viewtopic.php?f=180&t=29412

      The challenge is that your plugin would require all users to do the same. Daunting.. as some do not even know how to create a new folder.

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 2 Feb 2011, 21:07

        I have a Java '.jar' based alternative that is 'cross-platform' as long as Java is installed on the PC/MAC and access rights to the containing folder.
        It zips/unzips BUT needs supporting Ruby scripts to work...
        It's the basis of my SKM-tools that extract/make SKM files [which are in fact ZIP files]
        So PM me if you are interested... πŸ€“

        TIG

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 3 Feb 2011, 09:07

          @dahovey said:

          The ultimate thing I need to do is generate a PNG image file, being able to 'paint' each pixel. Already studied PNG documentation for what I need. That's simple enough. The compression seems to be the tough thing.

          Ditto - I was looking at it to read PNG data - easy up til the compression bit... 😞

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

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 3 Feb 2011, 09:54

            @thomthom said:

            @dahovey said:

            The ultimate thing I need to do is generate a PNG image file, being able to 'paint' each pixel. Already studied PNG documentation for what I need. That's simple enough. The compression seems to be the tough thing.

            Ditto - I was looking at it to read PNG data - easy up til the compression bit... 😞

            A cross-platform Java .jar can read and write PNG file [or most other image formatf] pixel by pixel - that's how my ImageTrimmer and related tools work... My 'thumbnail' tools take the larger image and the JAR saves a PNG with the reduced size... ImageTrimmer reads the image's PNG pixels and if they are transparent it makes them white if they abut an 'edge' they become black, any other pixels become white - the bufferedimage is written to a new PNG; for the purposes of this tool a DAT file is also written containing 0/1 for white/black pixels this is read directly into SUp to make edges that are them 'simplified'...
            It's easy to see a converse operation where the RB writes a DAT file of pixel values and the JAR reads that and makes a PNG using those... I know it's clunky but until Ruby gets some decent image manipulation tools built in it works...
            If you'd like ideas on this please PM me...

            TIG

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

            Advertisement