Coder Social home page Coder Social logo

jefurry / tlibmp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yeonzi/tlibmp

0.0 0.0 0.0 3.56 MB

A tiny libary that can read/write/edit .BMP files from disk

Home Page: http://www.short-circuits.org/tlibmp/index.html

License: MIT License

C 99.88% Makefile 0.12%

tlibmp's Introduction

tlibmp - tiny libbmp

license build language platform

A tiny libary that can read/write/edit .BMP files from disk

View project homepage

Basic

It was a lib that can create bmp file, and print in it.

these is some demo with this lib:

Color print

color

Draw lines

lines

Draw triangles

lines

Image processing

it also contain some basic image processing functions.

I use a picture from pixiv by (ˉ﹃ˉ)EM1234 as following:

origin

I have transform it to a bmp file named test.bmp,

Use this lib, I have made the following images:

Gray

gray

Binary

binary

Channel R

channel R

Channel G

channel G

Channel B

channel B

Mosaic

mosaic

mosaic

Histogram graph

histogram_r

histogram_g

histogram_b

histogram

Convolution

In mathematics convolution is a mathematical operation on two functions to produce a third function.

As picture can treated as a function, we can run convolution operation on a picture, and this will produce magical effect

Firstly, let's try a Gaussian function, the Matrix(convolution core) is:

1.0 4.0 7.0 4.0 1.0
4.0 16.0 26.0 16.6 4.0
7.0 26.0 41.0 26,0 7.0
4.0 16.0 26.0 16.6 4.0
1.0 4.0 7.0 4.0 1.0

and this matrix produce this picture:

gaussian

and then, let's try a matrix like this:

-1.0 -1.0 0.0
-1.0 0.0 1.0
0.0 1.0 1.0

easily to find that this matrix will produce a gray picture, just like a sculpture:

gaussian

a matrix like this will stress the edge of the picture:

0.0 -1.0 0.0
-1.0 5.0 -1.0
0.0 -1.0 0.0

stress

To make a color inverse, you can use a matrix with the summary small than zero:

inverse

tlibmp's People

Contributors

yeonzi avatar

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.