HISE Logo Forum
    • Categories
    • Register
    • Login

    HISE supports gif images

    Scheduled Pinned Locked Moved Feature Requests
    11 Posts 9 Posters 340 Views
    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
      aaronventure @CatABC
      last edited by

      @CatABC

      If it were added to the image component, webp would be a much better choice.

      You can already import a stitched image, or you can load in individual frames of a gif, then simply play through them using a timer (use the panel component for this).

      If you don't need to have other components on top of the gif, you can also use a WebView (no other HISE component can be rendered on top of the webview), and then you can import gifs, webp (way better) etc.

      ChazroxC rglidesR 2 Replies Last reply Reply Quote 2
      • ChazroxC
        Chazrox @aaronventure
        last edited by

        @aaronventure webview...gif pop-ups.... I like! 👍

        1 Reply Last reply Reply Quote 0
        • rglidesR
          rglides @aaronventure
          last edited by

          @aaronventure webp would be nice!

          1 Reply Last reply Reply Quote 0
          • L
            LozPetts @CatABC
            last edited by

            @CatABC Not sure what you're trying to do but this might help - if you want moving images in HISE what I did to get this working was:

            Link Preview Image
            CSS Sprite Generator - CSS Portal

            Welcome to CSS Sprite Generator, the fastest way for you to make CSS sprites.

            favicon

            (www.cssportal.com)

            Extract the frames from the GIF as PNG files - https://ezgif.com/split
            Convert all the PNGs into a filmstrip with the above CSS Sprite Generator
            Add your filmstrip to your project images folder
            Attach filmstrip to Panel in HISE.

            You'll need to tweak the timer and speed values to get it looking how you want.

            /** Looping Video Panel */
            inline function createHeadSprite(name, x, y)
            {
                local widget = Content.addPanel(name, x, y);
                
                Content.setPropertiesFromJSON(name, {
                  "width": WIDTH OF SINGLE PNG,
                  "height": HEIGHT OF SINGLE PNG,
                  "saveInPreset": true,
                  "allowCallbacks": "Clicks, Hover & Dragging"
                });
                
                // Asset Strip
                widget.loadImage("{PROJECT_FOLDER}FILMSTRIP.png", "filmstrip");
                
                widget.setPaintRoutine(function(g)
                {
                    // Calculate the index (the filmstrip has 100 slices, each ???px high
                    var index = parseInt(this.getValue()*197.0);
                    
                    g.drawImage("filmstrip", [0, 0, this.getWidth(), this.getHeight()], 0, index * ???);
                });
                
                // This is the sensitivity of the rotation
                widget.data.sensitivity = 300;
                
                // Save the down value as reference for all drag deltas
                widget.data.downValue = 0.0;
                
                widget.setMouseCallback(function(event)
                {
                    if(event.clicked)
                    {
                        // Store the current value for reference when dragging
                        this.data.downValue = this.getValue();
                    }
                    
                    if(event.drag)
                    {
                        // Use both axis to allow diagonal drag behaviour
                        var delta = event.dragX + -1.0 * event.dragY;
                        
                        // normalize the delta using the given sensitivity
                        var deltaNormalized = delta / this.data.sensitivity;
                        
                        // Calculate the new value and truncate it to 0...1
                        var newValue = this.data.downValue + deltaNormalized;
                        newValue = newValue - Math.floor(newValue);
                        
                        // Update the panel
                        this.setValue(newValue);
                        this.changed();
                        this.repaint();
                    }
                });
                
                return widget;
            };
            
            const sprite = createHeadSprite("LOOPPANEL", X, Y);
            
            //	timer for animation (FPS)
            reg count = 0;
            sprite.setTimerCallback(function()
            {
            	count = (count+1) % 24;
            	this.setValue(count * 1/24);
            	this.changed();
            });
            //Speed
            sprite.startTimer(62); //Play with this to set speed
            
            
            CatABCC xxxX 2 Replies Last reply Reply Quote 1
            • CatABCC
              CatABC @LozPetts
              last edited by

              @LozPetts Thank you for the information. My idea is that if HISE can support dynamic images by itself, some image displays will become more vivid.

              //I am a new student at HISE._
              //Windows11 & MacOS Ventura 13.6.7_

              1 Reply Last reply Reply Quote 0
              • dannytaurusD
                dannytaurus
                last edited by

                I'm curious to know what GIFs would be used for in a UI.

                I can't think of any plugins I have that have constantly looping animations in them.

                Meat Beats: https://meatbeats.com
                Klippr Video: https://klippr.video

                CatABCC 1 Reply Last reply Reply Quote 0
                • CatABCC
                  CatABC @dannytaurus
                  last edited by

                  @dannytaurus For example, if I want to show the atmosphere of a PAD sound, I can use a dynamic picture of rain or waterfall, which will make you feel more vivid.

                  //I am a new student at HISE._
                  //Windows11 & MacOS Ventura 13.6.7_

                  d.healeyD 1 Reply Last reply Reply Quote 1
                  • d.healeyD
                    d.healey @CatABC
                    last edited by

                    @CatABC Use lottie animation, it will scale nicely too.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    clevername27C 1 Reply Last reply Reply Quote 4
                    • clevername27C
                      clevername27 @d.healey
                      last edited by

                      @d-healey This is the way.

                      1 Reply Last reply Reply Quote 0
                      • xxxX
                        xxx @LozPetts
                        last edited by

                        @LozPetts

                        thanks for this

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post

                        19

                        Online

                        1.7k

                        Users

                        11.9k

                        Topics

                        103.3k

                        Posts