Code Monkey home page Code Monkey logo

gif2xls's Introduction

gif2xls

Inspired by xkcd.

Converts GIF encoded images into Microsoft Excel formatted workbooks.

Each frame is assigned a worksheet, and each pixel is assigned a cell.

There are two modes: fancy mode (the default) and boring mode. In boring mode (using -b or --boring at the command line), each cell is assigned a 25-bit integer, with bits 0-23 for an RGB value and bit 24 as transparency. In fancy mode, each cell is made square and is assigned a background colour that is as close to the original pixel value as possible.

An additional sheet named "Info" contains some header information, where each row contains a Name, Value pair.

Installation

gif2xls is now available as a PyPI package! Simply run either of the following from anywhere:

pip install gif2xls        # globally, often requires root/Administrator privileges
pip install gif2xls --user # local to current user (add ~/.local/bin to your $PATH)

To install from source, either run the following as root inside the repo directory:

pip install .

or the following to install as a user package (making sure to add ~/.local/bin/ to your $PATH):

pip install . --user

Usage

Syntax:

gif2xls input_file [-b|--boring] [--width cell_width] [-o output_file.xls(x)]

The default mode is "fancy" mode - use the --boring flag to use "boring" mode which doesn't use any colour formatting.

In "fancy" mode when using a .xlsx formatted output file, you can use the --width flag to specify how wide and high each cell will be in pixels. For example, --width=5 will generate cells that are 5 pixels wide and high each so that the image appears scaled up 5 times.

The output file can either have a .xls or a .xlsx file extension - signalling to gif2xls your output file format.

NOTE: You must use .xlsx output files for GIF images that are larger than 256 pixels wide - classic .xls worksheets do not support more than 256 columns per worksheet. However, you can still use .xls worksheets for fancy mode images, just as long as they are not wider than 256 pixels.

(C) Thomas Bell 2016, MIT License.

gif2xls's People

Contributors

bell345 avatar

Stargazers

KokaKiwi avatar Liam Cottam avatar Adam Starbuck avatar ajs124 avatar Craig Janis avatar

Watchers

James Cloos avatar  avatar

gif2xls's Issues

Syntax Error on Windows with Python 2.7

PS C:\Users\Michael\gif2xls> gif2xls gif.gif -o out.xlsx
Traceback (most recent call last):
  File "C:\Python27\Scripts\gif2xls-script.py", line 9, in <module>
    load_entry_point('gif2xls==0.2.0', 'console_scripts', 'gif2xls')()
  File "c:\python27\lib\site-packages\gif2xls\__init__.py", line 6, in main
    from .__main__ import main
  File "c:\python27\lib\site-packages\gif2xls\__main__.py", line 15
    print(msg, file=sys.stderr)
                   ^
SyntaxError: invalid syntax

Powershell on Windows 10, running Python 2.7

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.