ascii-image

A Java Clone of the ASCIImage Cocoa tool.

Лицензия

Лицензия

Группа

Группа

com.bloidonia
Идентификатор

Идентификатор

ascii-image
Последняя версия

Последняя версия

1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

ascii-image
A Java Clone of the ASCIImage Cocoa tool.
Ссылка на сайт

Ссылка на сайт

https://github.com/timyates/ascii-image
Система контроля версий

Система контроля версий

https://github.com/timyates/ascii-image

Скачать ascii-image

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.bloidonia/ascii-image/ -->
<dependency>
    <groupId>com.bloidonia</groupId>
    <artifactId>ascii-image</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.bloidonia/ascii-image/
implementation 'com.bloidonia:ascii-image:1.1'
// https://jarcasting.com/artifacts/com.bloidonia/ascii-image/
implementation ("com.bloidonia:ascii-image:1.1")
'com.bloidonia:ascii-image:jar:1.1'
<dependency org="com.bloidonia" name="ascii-image" rev="1.1">
  <artifact name="ascii-image" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.bloidonia', module='ascii-image', version='1.1')
)
libraryDependencies += "com.bloidonia" % "ascii-image" % "1.1"
[com.bloidonia/ascii-image "1.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Java 8 copy of the ASCIImage project

For original, see: http://cocoamine.net/blog/2015/03/20/replacing-photoshop-with-nsstring/

Todo:

  1. Scaling doesn't work right (pixels on the extremes of the image, don't stay there
  2. Need to output JavaFX Groups

Examples:

A filled circle:

Circle

List<String> circle = Arrays.asList(
    "· · · · · 1 · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "· · · · · · · · · · ·",
    "1 · · · · · · · · · 1");
BufferedImage img = AsciImageProcessor
        .fromLines(circle)
        .asBufferedImage(c -> c.type(BufferedImage.TYPE_INT_ARGB).graphics(g -> {
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        }))
        .render(e -> e.graphics(g -> {
            g.setPaint(Color.RED);
        }));
ImageIO.write(img, "png", new File("/tmp/circle.png"));

A beetle:

Beetle

List<String> beetles = Arrays.asList(
        "· · · · 3 · · · · · · · · · · · · ·",
        "· · · · · · · · · 7 · · · · · · · ·",
        "· · · · · · · · · · · · · · · · · ·",
        "· · · 1 3 · · 1 · · · · · · · · · ·",
        "5 · · 5 · · · · · · · · · · · B · ·",
        "· · · · · 2 · · · 7 · · · · 2 · · ·",
        "· · · · · · · · · · · · · · · · · ·",
        "· · · 1 · · · 1 · · · · · · · · · ·",
        "· · · · · · · · · · · B · 9 · · · ·",
        "· 8 · · · 8 · · · · · · · · · · · ·",
        "· · · · · · · · · · · · · · · · · ·",
        "· · · · · · · · C · · · · · · · · ·",
        "· · · · · · · · · · · · · · · · · 9",
        "· · · · · · · · A · · · · · · · · ·",
        "· · · · · 2 · · · · · · · · 2 · · ·",
        "· · · · C · · · · · · · · · · · · ·",
        "· · · · · · · · · · · · · · · · · ·",
        "· · · · · · · · · · · · A · · · · ·");
img = AsciImageProcessor
        .fromLines(beetles)
        .asBufferedImage(c -> c.scale(5.0).type(BufferedImage.TYPE_INT_ARGB).graphics(g -> {
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g.setPaint(Color.BLACK);
        }))
        .render();
ImageIO.write(img, "png", new File("/tmp/beetles.png"));

Версии библиотеки

Версия
1.1