Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:16:57+00:00 2026-06-05T09:16:57+00:00

What would be the easiest way to include a simple (about 7 seconds long)

  • 0

What would be the easiest way to include a simple (about 7 seconds long)
cartoon in Phonegap app?

I tried mp4 video but Android won’t play local video file through <video> html5 tag. Then I tried with animated GIF but I lost too much quality and the file was too big. Afterwards I tried to export everything to JPG files and switch them using javascript but it was breaking all the time (and the app got huge – about 7MB for 7second video).

Another problem are different resolutions – I want my cartoon to be in an acceptable quality on hi-res as well as low-res devices..

So can anybody suggest how something like this could be done?

thanx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:16:58+00:00Added an answer on June 5, 2026 at 9:16 am

    Reading simple cartoon animation, I understand it as something which could be made with a smaller color palette.
    For this an animated GIF should have been acceptable, but with it’s own set of problems.

    A post suggested that using a sprite sheet of indexed PNGs may solve GIF timing issues and also be smaller than an animated GIF. The link had what looked like a 2 color animation, so I tested the hypothesis for myself. I used an 170×170 animated GIF (216 color palette; 40ms between frames) with 101 frames to test which was 229,041 bytes.

    After extracting the individual frames as separate (indexed color) PNGs, the total size of the files was 375,242 bytes.
    I used ImageMagick to extract the frames:

    convert sca.gif -coalesce sca_%d.png
    

    Then created a sprite sheet – again, using ImageMagick:

    montage -geometry 170x170 sca_*.png SpriteSheet.png
    

    which was 221,228 bytes (which is smaller than the source GIF). The output had 11 cols x 10 rows.

    EDIT: The order of the frames in this case turned out as sca_2.png was added after sca_19.png due to the way the ***** glob expands. A batch snippet is included below to create the sprite sheet in the correct order.

    As you mention the animated GIF lost too much detail – it leads me to think that your video may require high color depth (or you need to export the GIF without dithering). For this, you could try creating a sprite sheet from the JPEGs. You mention the JPEGs added up to 7MB – with a little more work, perhaps you could reduce the number of frames in the video by removing duplicate frames (and/or reducing the frame rate of your source animation/video). For removed (duplicate) frames, you could adjust the frame delay.

    This could be encoded in a descriptor object in javascript. Such as:

    var animFrameTimes = [40, 40, 100, 100, ..., 40, 200, 40, 40]; // milliseconds between frames
    

    This data could be used to adjust the timeout to use between frames such as in the filmstripper function in the reference link.

    Additional example of a simple implementation of 2D sprite animation.
    Sprite sheet of additional example

    A gotcha to keep in mind is that some devices (iOS) may not support sprite sheets that are too large. You may need to split your sprite sheet into multiple sheets as a workaround. All this depends upon how important showing the animations/videos is to you.

    Finally, to handle devices with different resolutions, you could have a few of these sprite sheets created at different resolutions if the largest being scaled down does not offer the desired visual quality. Then load them conditionally based on the device.

    EDIT: Batch snippet to create sprite sheet with frames in the correct order createSpriteSheet.bat:

    @echo off
    setlocal enableextensions enabledelayedexpansion
    set fileList=
    FOR /L %%n IN (0,1,100) DO (
        if not "!fileList!" == "" set fileList=!fileList!
        set fileList=!fileList! sca_%%n.png
    )
    REM echo %fileList%
    montage -geometry 170x170 %fileList% SpriteSheet.png
    endlocal
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the easiest way of using commands in the code to programatically
What would be the easiest way to have the color of a text field
What's the easiest way to generate a bitmap using Python? Text support would be
I would like to know what is the best, fastest and easiest way to
What would be the easiest or recommended way for making an NSOutlineView indent multiple
Something as simple as: $(#div).addClass(error).delay(1000).removeClass(error); doesn't seem to work. What would be the easiest
What is the easiest way to include a tooltip in the gridView column? For
I'm trying to use nant because I thought it would be the easiest, but
What would be the easiest way to get the current day of the week
I'm using Eclipse PHP Development Tools. What would be the easiest way to access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.