Giter Club home page Giter Club logo

Comments (2)

Yttrium-tYcLief avatar Yttrium-tYcLief commented on August 12, 2024

title says it all, the program could pull screenshots i mean make them and put them in the program

if you mean desktop scrotter pulls images from phone directly, i did this in the past but it became a pain because of adb not being set up properly on other devices. i could look into re-enabling it sometime.

Also if you could add the option for multiple and stiching in the android app

not happening with good reason. the way scrotter works, it layers multiple different very high resolution 32bpp (RGBA8888) images on top of each other based on your options (shadows, gloss, etc). your screenshot is one of those layers. then it renders and saves the new bitmap. the issue with this is that each time it opens a new image, that image has to be loaded into memory.

the most memory efficient way to do this while being sane would be to load a bottom image, and then load the second image. layer the second image on top of the first image and delete the second image. then open the third, layer that, delete. do this until you've got a single image loaded in memory with everything, then save that. then, for an array, you do it again and again for each screenshot. once you have all your images, create a new blank canvas with the proper width and then paint these images one by one, being sure to close them just before opening a new one.

so basically, assuming we have 32bpp images, and we take the nexus 5, assuming bitmaps are stored compressed in memory and we use the most basic non-gloss non-shadow image, we do the following calc:

  • open device img to bitmap1
    • memory used: 1.3MB
  • open screenshot to bitmap2
    • memory used: 3MB
  • draw bitmap2 on bitmap1
    • memory used: 3.2MB
  • close bitmap2
    • memory used: 1.5MB
  • save bitmap1 to cache
    • memory used: 1.5MB
  • close bitmap1
    • memory used: 0MB

let's say we do that for four images (desktop limit is 7) and want to make an array. now, with all these images in our cache, we do the following:

  • open img1
    • memory used: 1.5MB
  • create new bitmap 4x width 1x height of img1 to canvas
    • memory used: 1.6MB
  • draw img1 on canvas
    • memory used: 3.1MB
  • close img1
    • memory used: 1.6MB
  • open img2
    • memory used: 3.1MB
  • draw img2 on canvas
    • memory used: 4.6MB
  • close img2
    • memory used: 3.1MB
  • open img3
    • memory used: 4.6MB
  • draw img3 on canvas
    • memory used: 6.1MB
  • close img3
    • memory used: 4.6MB
  • open img4
    • memory used: 6.1MB
  • draw img4 on canvas
    • memory used: 7.6MB
  • close img4
    • memory used: 6.1MB

now, taking into account that resolutions can be higher than this, that bitmaps are stored uncompressed, that we don't really have much cache to work with, cache is slow, this is with no gloss or shadows, and that our app can never exceed 15MB of RAM without switching to 3d rendering, i think it's pretty safe to say that NO, arrays will not happen on a phone.

from scrotter.

pitastrudl avatar pitastrudl commented on August 12, 2024

Thanks for the answer, sry for late reply, looks like gmail thinks you are
spam.

cheers

from scrotter.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.