Giter Site home page Giter Site logo

bmpmanipulator's Introduction

BMPManipulator

My first Python project! January 17, 2015


Example

I've got a few small example images you can use.

Before & After

Using it

To do the 90 degree rotation above, on the fivebysix.bmp file in the same directory:

python ImageManip2.py -f fivebysix.bmp -o rotated.bmp --90
  • Notice the print statement debugging
  • Also notice the rotated.bmp file now in the directory


Parser inputs:

-f: required, followed by the image file path
-o: required, followed by the output file path of the new image
--hflip: if set, flips the image horizontally
--vflip: if set, flips the image vertically
--90: if set, rotates the image 90 degrees to the right
--180: if set, rotates the image 180 degrees
--270: if set, rotates the image 270 degrees to the right

Help:

python ImageManip2.py --help


Well...

In addition to the code being a bit rough on the eyes, it also doesn't work, not completely.

I began with 3x3 pixel images, and worked up to 5x6, 4x3, 4x2, 6x6, and 2x4. These all work. But my code relies on some constants that seem to only work for these BMPs, but which aren't true for all BMPs.

I suspect a lot of this has to do with my padding variables.

That said, my functions do work with these files, which means that my underlying logic works.

I have some extra printouts in there for debugging.

All in all, the code is pretty darn rough. I made this about two years ago after completing the Codecademy Python course. I had a lot of fun, and learned a thing or two.

Now, I'm glad I've improved enough to recognize the many ways that I should refactor this.

I've only got 3 weeks left at RC, however. I'm tempted to re-write this to show myself how I've improved, but for now I'm going to spend my time trying to get Pressure Pong going.

I'll come back to you, BMP Project.

bmpmanipulator's People

Contributors

reeddunkle avatar

Watchers

James Cloos avatar  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.