tileex

command module
v0.0.0-...-3253ffb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

#+TITLE:TileEx - A Tiling Pattern Extractor written in Go
This program takes in images of tiling wallpapers and extracts the tile from them. If you have ever found yourself enviously staring at someone's cool tiling wallpaper, you can now extract it from a screenshot!
* Usage Examples
** Trivial Case
Given the file below, ~input.png~

[[./Examples/example-1.png]]

Running ~go run main.go~ gives the following ~output.png~ file:

[[./Examples/output-1.png]]

Result of tiling it with ~feh --bg-tile output.png~:

[[./Examples/tileex-out-1.png]]
** When there's other things in the image
Given the file below, ~screenshot.png~

[[./Examples/example-2.png]]

Running ~go run main.go -input screenshot.png -row-prefer-frequency -col-tolerance 40~ gives the following ~output.png~ file:

[[./Examples/output-2.png]]

Result of tiling it with ~feh --bg-tile output.png~:

[[./Examples/tileex-out-2.png]]
** When there are things on the top left of the image
Given the file below, ~input.png~

[[./Examples/example-3.png]]

Running ~go run main.go -y-offset 400 -row-prefer-frequency -col-prefer-frequency -output tile.png~ gives the following ~tile.png~ file:

[[./Examples/output-3.png]]

Result of tiling it with ~feh --bg-tile tile.png~:

[[./Examples/tileex-out-3.png]]
* Usage Instructions
Crop the screenshot so that any elements that are not a part of the tile get cropped out as far as possible. *Horizontal and vertical status bars especially*.
You might still have some things left on the screen, in which case you can adjust the tolerance or pick the period based on frequency as seen in the second example.
In case there's something on the top or left of the image, you can adjust the x and y offsets to crop the final tile out of some other area, as seen in the third example.
* Caveats
JPG/JPEG detection does not work very well.
* License
This program is licensed under the GNU General Public License, version 3 or later.

Documentation

Overview

TileEx : A Tiling Pattern Extractor written in Go Copyright (C) 2023, Sarthak Shah (shahsarthakw@gmail.com)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL