Coder Social home page Coder Social logo

python_scripts's Introduction

Python scripts

These are random python scripts that I work on as they are needed. Here is a little description for each one:


./imageTools/imageToSprite

This was a fun project to convert a normal image to a pixel art. The Idea came while working on my portfolio and not being able to draw any decent pixel art. This project uses:

  • OpenCV 2
  • Numpy
  • SKlearn's KMeans cluster

NOTE: SKleanr's KMeans cluster is needed since it is used to calculate the dominant color of the area to convert to one pixel.

Examples:

Autum leaves - ( 1 pixel = 6 pixels from original ):

Alt text

Original

Alt text

Result

Link Image - ( 1 pixel = 16 pixels from original ):

Alt text

Original

Alt text

Result

Here is an example of how the pixel is created:

Alt text

With the Kmeans cluster we find the most dominant color, in this case c, and then we replace the values in the new image with that smae color. To avoid having to resize the image and keep the same resolution, we do not convert the 4x4 matrix into a 1x1 with the color. We create a new 4x4 matrix with the dominant color in all the cells so the resolution doesn't change.


./deansListExcelToHTML

This script was made for a job I was working on. This script uses xlWings to handle the excel file.

NOTE: I do not recommend using this one since it was specifically made for a website and the excel file requires a specific format.

python_scripts's People

Contributors

sopranopillow avatar

Watchers

 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.