Coder Social home page Coder Social logo

moxwel / winlabeler Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 211 KB

Tool for creating custom Windows folder icons and labels.

License: MIT License

Python 100.00%
custom-icons customization folder-icons folders icons personalization windows windows10 collaborate learn communityexchange imagemagick python

winlabeler's Introduction

banner

WinLabeler

The easiest way to create your own custom Windows folder icons.

๐Ÿšง In development ๐Ÿšง

This project is still in development. But there is already a working prototype.

How to use

๐Ÿ’ก You need ImageMagick installed on your computer. You can download it here.

First install Wand:

pip install Wand

Then, run the script:

python winLabeler.py "C:\Users\User\example.png"
Output name will be "out.ico" by default. Program will use a folder for the small icon by default

python winLabeler.py "C:\Users\User\example.png" -ns
Output name will be "out.ico" by default. Program will not use a folder for the small icon

python winLabeler.py "C:\Users\User\example.png" -ns -o "my_icon.ico"
Output name will be "my_icon.ico". Program will not use a folder for the small icon

What -ns does

-ns stands for "no small folder". It means that the program will not use a folder for the small icon.

Here is an example of the difference:

small-folder

โš  Expect some bugs. This is sill a proof of concept.

winlabeler's People

Contributors

fsabuhi avatar moxwel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

winlabeler's Issues

Make one-line console application

The program prints texts and prompts. The final program must be a one-line console program, using CLI arguments.

Possible arguments

  • First position: -p --path Icon path (Required)
    Not necessary to have a flag associated with this.

  • Second position: -ns --no-small-folder (Optional)
    "small-folder" refers to the style of the small icon resolution.
    image
    If not specified, defaults to "small-folder".

  • Third position: -o --output Output file name (Optional)
    If not specified, defaults to "out.ico".

Examples

python winLabeler.py "C:\Users\User\example.png"
python winLabeler.py "C:\Users\User\example.png" -ns
python winLabeler.py "C:\Users\User\example.png" -ns -o "my_icon.ico"

Make icon shadow adjustable

Make the shadow adjustable through CLI arguments.

image

Example

python winLabeler.py "C:\example.png" --shadow 5
python winLabeler.py "C:\example.png" -sh 5

Add shadow with 5 gaussian filter (Image.shadow(alpha=50, sigma=5, x=0, y=0))

python winLabeler.py "C:\example.png"

No shadow

FileExistsError when trying to save a file with same name

Steps to reproduce

Execute one time.

python winLabeler.py "C:\example.png"

No problem. Execute again.

python winLabeler.py "C:\example.png"

Python throw FileExistsError because out.ico already exists.

Possible solution

Rename the new out.ico to out1.ico. It means there must be a check before saving to output folder.

Save more resolutions into icon file

The program saves the following resolutions: 256, 48, 32, 16.

The Windows folder icon has many more: 256, 64, 48, 40, 32, 24, 20, 16.

File Explorer normally renders only 256, 48, 32 and 16, but for compatibility reasons, maybe is necessary to have all those resolutions saved too.

Extract folder icon from Windows system files

The icon is located at C:\Windows\System32\shell32.dll and C:\Windows\System32\imageres.dll. It can be extracted inside Windows.

Why?

A script that helps extract the icon can help to not have the images in the repository (avoiding potential copyright).


Research

  • In some Windows installations, the icons are relocated to C:\Windows\SystemResources\shell32.dll.mun and C:\Windows\SystemResources\imageres.dll.mun. Reference

  • The software IconsExtract from NirSoft can extract icons from .dll files. It is freeware, although is not open source.

  • The project icoextract can extract icons from .dll files. It's open source too.

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.