Coder Social home page Coder Social logo

aml-imgpack's Introduction

aml-imgpack

Resource packer/unpacker for Amlogic Logo image files

About bootup.bmp

Make sure you respect the original image sizes and depth, or else u-boot might be confused.

For instance, bootup.bmp is 360x360@16bpp.

Help

$ ./aml-imgpack.py --help
usage: aml-imgpack.py [-h] [--unpack] [--pack PACK] file [file ...]

Pack and unpack amlogic uboot images

positional arguments:
  file         an integer for the accumulator

optional arguments:
  -h, --help   show this help message and exit
  --unpack     Unpack image file
  --pack PACK  Pack image file

Listing assets in an image

$ ./aml-imgpack.py logo.img
Listing assets in logo.img
AmlResImgHead(crc=0x952fde3b version=2 imgSz=1160640 imgItemNum=8 alignSz=16)
    AmlResItem(name=upgrade_unfocus start=0x240 size=184)
    AmlResItem(name=upgrade_success start=0x300 size=180072)
    AmlResItem(name=upgrade_error start=0x2c270 size=180072)
    AmlResItem(name=upgrade_fail start=0x581e0 size=180072)
    AmlResItem(name=bootup start=0x84150 size=259272)
    AmlResItem(name=upgrade_bar start=0xc3620 size=184)
    AmlResItem(name=upgrade_logo start=0xc36e0 size=180072)
    AmlResItem(name=upgrade_upgrading start=0xef650 size=180072)

Unpacking an image

Note that the assets name are appended with a .bmp extension to make edition easier.

$ ./aml-imgpack.py --unpack logo.img
Unpacking assets in logo.img
  Unpacking upgrade_unfocus
  Unpacking upgrade_success
  Unpacking upgrade_error
  Unpacking upgrade_fail
  Unpacking bootup
  Unpacking upgrade_bar
  Unpacking upgrade_logo
  Unpacking upgrade_upgrading

Packing an image

Note that any .bmp will be stripped from the asset name.

$ python aml-imgpack.py --pack out.img *.bmp
Packing files in out.img:
  bootup (259272 bytes)
  upgrade_bar (184 bytes)
  upgrade_error (180072 bytes)
  upgrade_fail (180072 bytes)
  upgrade_logo (180072 bytes)
  upgrade_success (180072 bytes)
  upgrade_unfocus (184 bytes)
  upgrade_upgrading (180072 bytes)

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.