Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1017 Bytes

README.md

File metadata and controls

54 lines (37 loc) · 1017 Bytes

jsixel-awt

This module lets you use BufferedImage from Java's Swing/AWT, allow you to either encode a BufferedImage to sixel data, or decoding sixel data to a BufferedImage.

Back To JSixel

Quick Start

<dependency>
	<groupId>com.sshtools</groupdId>
	<artifactId>jsixel-awt</artifactId>
	<version>0.0.2-SNAPSHOT</version>
</dependency>

JPMS

requires transitive com.sshtools.jsixel.awt;

BufferedImage -> Sixel

To convert a BufferedImage to a sixel stream.

// Create the image codec
var codec = new BufferedImageCodec();

try (var in = Jsixel.class.getResourceAsStream("jsixel.png")) {
	// Load the image
	var bitmap = codec.load(Optional.of(ImageType.PNG), in);
	
	// Build a sixel encoder
	var enc = new Bitmap2SixelBuilder().
			fromBitmap(bitmap).
			build();
			
	// Write the converted buffer to your output stream
	conv.write(System.out);
}

Sixel -> BufferedImage

To convert a sixel stream to a BufferedImage..

XXXXX