Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Png images
Forum Updated to NodeBB v4.3 + New Features

Png images

Scheduled Pinned Locked Moved Mobile and Embedded
15 Posts 4 Posters 6.7k Views 1 Watching
  • 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.
  • F Offline
    F Offline
    f.vanalmetelevic.com
    wrote on last edited by
    #6

    The final size of the executable is 1198462 bytes.
    Target has 64 Mb of RAM.
    Not yet tested when not compiled in to application.
    Number of png's in qrc file : 170!

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #7

      If you are targeting a particular device it is pointless to rescale the images at runtime over and over again. Much better idea to rescale them once offline and use the rescaled images directly.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Chuck Gao
        wrote on last edited by
        #8

        [quote author="ZapB" date="1305897728"]If you are targeting a particular device it is pointless to rescale the images at runtime over and over again. Much better idea to rescale them once offline and use the rescaled images directly.[/quote]

        Agree. Different device, different resolution.

        Chuck

        1 Reply Last reply
        0
        • F Offline
          F Offline
          f.vanalmetelevic.com
          wrote on last edited by
          #9

          Just to be sure my reasoning is right :
          One of the images is 25Kb in size. If I open that image, the size is 3289x1385 pixels. So, if we have to rescale that, the app has to load the original image in memory meaning consuming 3289x1385x3 = 13,66Mb of RAM (if I assume 24 bits per pixel). Right ?

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on last edited by
            #10

            Yes except it is more likely 4 bytes per pixel since it could well be using RGBA pixel format. What is your screen resolution on your device? I doubt it is anywhere near that image size is it?

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0
            • F Offline
              F Offline
              f.vanalmetelevic.com
              wrote on last edited by
              #11

              The screen resolution of the target is 800x480 !
              Well, it's clear that this way of working is not a good choice at all... it looks like the application will need some rework...
              Resizing the images once to their correct size will certainly resolve the "out of memory" problem...

              Thanks !

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #12

                The app should not need much reworking if it is already using the larger images. You just need to spend a little time in your favourite image editor rescaling the png's to more suitable sizes. Another bonus is that yoru app will load faster (since it will be smaller) and it will also display the images faster since there will be no slow software scaling to be performed.

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  f.vanalmetelevic.com
                  wrote on last edited by
                  #13

                  Stupid remark of me...! Of course, app should normally not change one byte... only scale images.

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #14

                    No worries - it's Friday afternoon. My brain has already departed for the weekend ;-)

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      srikanth_trulyit
                      wrote on last edited by
                      #15
                      1. Imaging scaling is very expensive and memory constrained in low memory devices like handhelds.
                      2. Why don't you use svg instead of png. They scale to the target resolution and work like a charm in low memory targets.
                      3. If you still prefer to use png files, please scale it yourself and provide an image cache that resides on the disk rather than on RAM. If you downscale try doing a "cheat scale":http://labs.qt.nokia.com/2009/01/26/creating-thumbnail-preview/
                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved