GithubHelp home page GithubHelp logo

jruit / layerdivider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattyamonaca/layerdivider

0.0 0.0 0.0 39.35 MB

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

License: MIT License

Python 40.84% PowerShell 0.74% Jupyter Notebook 58.42%

layerdivider's Introduction

layerdivider

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

Open In Colab

スクリーンショット 2023-03-07 034638

スクリーンショット_20230307_035053

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

Local Install

Required Dependencies

Python 3.10.8 and Git

Windows Installation

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 webstie localhost:port to use(The default is localhost:7860).

処理内容

  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.

パラメータ説明

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

Parameter Description

  • roop: 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 sdbds 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.