GithubHelp home page GithubHelp logo

nuooos / layerdivider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattyamonaca/layerdivider

0.0 0.0 0.0 28.47 MB

A tool to divide a single illustration into a layered structure.

License: MIT License

Python 52.30% PowerShell 2.81% Jupyter Notebook 44.88%

layerdivider's Introduction

layerdivider

A tool to divide a single illustration into a layered structure. スクリーンショット 2023-03-07 034638

スクリーンショット_20230307_035053

CLIP.STUDIO.PAINT.2023-03-07.04-37-36.mp4

Install

use Google Golab

Open In Colab

  1. Click colab button.
  2. Run all cells.
  3. Click output addres(Running on public URL: https: //xxxxxxx.gradio.live).

Local Install

Windows Installation

Required Dependencies

Python 3.10.8 and Git

install Step

git clone https://github.com/mattyamonaca/layerdivider
  1. run install.ps1 first time use, waiting for installation to complete.
  2. run run_gui.ps1 to open local gui.
  3. open website localhost:port to use(The default is localhost:7860).

Optional: For Python Launcher Users

If you use Python launcher (py command) for executing Python, you should use install_with_launcher.ps1 instead of install.ps1. The reason is install_with_launcher.ps1 uses py command for executing venv module, while install.ps1 uses python command.

処理内容

  1. 入力された画像をピクセル単位でRGB情報に従いクラスタリング
  2. 色の類似度(CIEDE2000基準)が近いクラスタを統合
  3. 入力された画像をブラー処理で平滑化
  4. クラスタごとにブラー処理後の色の平均値を出し、算出した平均値ですべてのピクセルを塗りなおし
  5. 2-4を指定された回数繰り返し実行
  6. 最終的なクラスタリング結果に基づき、ベースとなるレイヤーを作成
  7. ベースレイヤーの各色を、入力された画像のクラスタ毎の平均色で塗りなおし
  8. ベースレイヤーとオリジナルの色差に基づいて効果レイヤーを算出

Processing content

  1. Cluster the input image based on RGB information at the pixel level.
  2. Merge clusters with similar color similarity (based on CIEDE2000 criteria).
  3. Smooth the input image using a blur process.
  4. For each cluster, calculate the average color value after blurring and repaint all pixels with this calculated value.
  5. Repeat steps 2-4 for a specified number of times.
  6. Create a base layer based on the final clustering result.
  7. Repaint each color in the base layer with the average color of each cluster in the input image.
  8. Calculate an effect layer based on differences between the base layer and original colors.

パラメータ説明

  • loops: 処理2-4を繰り返す回数
  • init_cluster: 処理1で生成するクラスタの数(大きいほど細かくレイヤー分けされる)
  • ciede_threshold: 処理2でどの程度色が類似していたらクラスタを結合するか決める閾値
  • blur_size: 処理3でかけるブラー処理の大きさ(大きいほど強くぼかす)
  • output_layer_mode
    • normal: 通常レイヤーのみで出力されるPSDを構成
    • composite: 通常レイヤー、スクリーンレイヤー、乗算レイヤー、減算レイヤー、加算レイヤーを組み合わせて出力されるPSDを構成

Parameter Description

  • loops: Number of times to repeat processing 2-4.
  • init_cluster: Number of clusters generated in process 1 (the larger the number, the more finely layered it is).
  • ciede_threshold: Threshold for determining when to combine clusters in process 2 based on how similar their colors are.
  • blur_size: Size of the blur applied in process 3 (the larger the size, the stronger the blurring effect).
  • output_layer_mode:
    • normal: Constructs a PSD that only includes normal layers.
    • composite: Constructs a PSD by combining normal layers with screen, multiply, subtract and add layers.

layerdivider's People

Contributors

mattyamonaca avatar yugentakadaka avatar sdbds avatar spinachpasta 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.