Giter Club home page Giter Club logo

img2mif's Introduction

###img2mif


Image to .mif file converter for use in Altera Quartus FPGA development.

Converts images to Altera Memory Initialization File (.mif) format.

How to use:
Pass the image, width in bits of the memory, the depth of the memory, how many bits per pixel for the memory, and color format. Color format is either 0 for Grayscale or 1 for RGB. RGB color will set the RGB elements of a pixel as consecutive memory locations.

	img2mif -width -depth -bpp -color
	
	width : Width of memory in bits. Only support for 8, 16, 32, 64, 128 at the moment.
	depth : Depth of the memory structure. Only valid choices are 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288.
	bpp : Bits per pixel of the output. Uses basic thresholding to truncate image data.
	color: Set to 0 for auto RGB output. Set to 1 for grayscale.

	EX : img2mif tester.bmp 8 8192 2 1

If the image is too large for the memory it will fill up as much of the memory as possible then give a warning. If the image does not take up all the space the other locations will be filled with 0.

So far RGB is currently not implemented and a couple sections are untested but should work. Seems bitmaps are the best choice as file inputs. Uses the [stb image library] (https://github.com/nothings/stb) for opening up images and getting the pixel data. Included is a copy of stb_image.h that I used for building.

Memory Initialization Format (.mif) file documentation can be found [here] (http://quartushelp.altera.com/9.1/mergedProjects/reference/glossary/def_mif.htm).

Author: Parker Dillmann
Website: [Longhorn Engineer] (www.longhornengineer.com)


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.