2017 © Pedro Peláez
 

library split-image

Split PNG images into pieces.

image

drezynsoft/split-image

Split PNG images into pieces.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Split Image

Split Image is a tool written in PHP to split images in format of PNG to smaller pieces. What is more valuable it could be used to split images with repetition of the left/right top/bottom fragments to get atlas form of presentation., (*1)

Installation

composer require drezynsoft/split-image

or simply download the package in zip format., (*2)

Configuration

You can use the config/config.php file or just override default options with args in console., (*3)

config/config.php options

Params obliged:

After split command: source-file

Path to PNG file to split., (*4)

After source-file: destination-dir (second after split command)

Path to directory where split files will be saved., (*5)

Note: Minimal command is as follows (warning: last slash is required):, (*6)

$ split-image split path/to/png/file.png path/to/save-dir/, (*7)

Note: Trailing slash in directory path is necessary., (*8)

List of other available params:

--width default: 2200 (int)

Destination width [px] of the every split image., (*9)

--height default: 3300 (int)

Destination height [px] of the every split image., (*10)

--left-right-margin default: 500 (int)

Margin of the previous (if any) split image. It is the simply floating coat of the previous split image (in width) [px]., (*11)

--top-bottom-margin default: 500 (int)

Margin of the previous (if any) split image. It is the simply floating coat of the previous split image (in height) [px]., (*12)

--sep default: '_' (string)

Text between digits of rows count and cols count., (*13)

--prefix default: '' (string)

Text before digits of rows and cols., (*14)

--suffix default: '' (string)

Text after digits of rows and cols., (*15)

--RAM-factor default: 3.0 (float)

Multiplier for calculating predicted RAM usage., (*16)

--compression default: 0 max: 9 (int)

Compression of PNG file 0-9., (*17)

Note: All params starting with -- are optional and could be given in any order. Also all of them can be used in config/config.php without the -- prefix., (*18)

List of params outside of the console:

default-file default: 'data/to_convert/DrezynSoft.png' (string)

Source file., (*19)

default-dir default: 'data/converted/' (string)

Destination directory., (*20)

Usage

Simplest usage (with defaults)

By console

$ vendor/bin/split-image split path/to/png/file.png path/to/save-dir/, (*21)

or without composer, (*22)

$ scripts/split-image split path/to/png/file.png path/to/save-dir/, (*23)

Note: Trailing slash in directory path is necessary., (*24)

Tip: When params in config/config.php are the same you would like to use, you don't have to pass them into console command. The params will be get from config file., (*25)

By http

go to: http://example.com/split-image/, (*26)

Note: With assumption that tool is installed in split-image dir in public of the site., (*27)

Recommendation: When you use huge files it can take long to split so end of script execution could interrupt the process., (*28)

Note: There is no possible to change defaults options. You can only edit the config/config.php and then open the http page., (*29)

Issues

The tool has been made for one reason at one moment so we really can not to predict new version of this program., (*30)

The Versions

26/07 2016

dev-master

9999999-dev http://drezynsoft.fotokrajobrazy.warmia.pl

Split PNG images into pieces.

  Sources   Download

Custom

The Requires

  • php >=5.3.0
  • ext-gd *

 

image split png file

26/07 2016

1.0.2

1.0.2.0 http://drezynsoft.fotokrajobrazy.warmia.pl

Split PNG images into pieces.

  Sources   Download

Custom

The Requires

  • php >=5.3.0
  • ext-gd *

 

image split png file

26/07 2016

1.0.1

1.0.1.0 http://drezynsoft.fotokrajobrazy.warmia.pl

Split PNG images into pieces.

  Sources   Download

Custom

The Requires

  • php >=5.3.0
  • ext-gd *

 

image split png file

26/07 2016

1.0.0

1.0.0.0 http://drezynsoft.fotokrajobrazy.warmia.pl

Split PNG images into pieces.

  Sources   Download

Custom

The Requires

  • php >=5.3.0
  • ext-gd >=2.1.0

 

image split png file