GithubHelp home page GithubHelp logo

zianelijahsmith / python_image_converter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 50 KB

I got tired of using a web converter like https://convertio.co/ to convert images, so I made my own.

License: GNU General Public License v2.0

Python 100.00%
conversion converter

python_image_converter's Introduction

Python_Image_Converter

As of January 12th 2023, everything works now!

Please note .jpeg and .jpg are the exact same format, so there's no need to convert from .jpeg to .jpg and vice versa.

Background

I got tired of using a web converter like https://convertio.co/ to convert images, so I made my own.
Everything works now, but I might update it later.

My initial intent when coding this was just simply making a function that I could import into iPython and then give the function the following arguments:

  1. A path to the image I want to convert
  2. A format I want to convert it in

As I began coding, I thought of more ideas and use cases. So currently debating myself if I should just leave this as a function or update features such as adding more image formats or adding a gui, the ideas are endless tbh.

To use

To use this you have two options:

  1. Copy and paste the entire function into an interpreter like iPython
  2. Import it into your interpreter directly

Then call the function with the arguments. Example:

convert_image('/home/user/test/chad.webp', '.jpg')
You should see chad.wbp.jpg in the directory now.
When I was testing this program, I made sure it actually changed formats, it works.

Will try to convert this code into something more modular later so it can be easily copied and pasted when making modules, classes, functions, etc.

For now, enjoy and hope you find this useful for either converting images or learning Python!

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.