Java Image Library

Java Prelim and Studio image library.

License

License

GroupId

GroupId

org.keeber
ArtifactId

ArtifactId

simple-img
Last Version

Last Version

0.0.6
Release Date

Release Date

Type

Type

jar
Description

Description

Java Image Library
Java Prelim and Studio image library.
Project URL

Project URL

https://github.com/json-k/simple-img
Source Code Management

Source Code Management

https://github.com/json-k/simple-img

Download simple-img

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
com.github.jai-imageio : jai-imageio-core jar 1.4.0

Project Modules

There are no modules declared in this project.

Simple Image

Simple image is a Java image read / write library.

Philosophy

Reading and writing images should be easy right? Oh, and I need to write the resolution, some XMP etc... BTW I also need to read the custom XMP, you know, like PhotoShop right?

This happens a lot in the Premedia / Studio Imaging industries and for some reason we always assume it will be simple, but in fact, it really isn't. This library wraps some of the java ImageIO and JAI calls and functions into something that can be implemented easily in production.

Maven

The project is available SOON in the Maven Central Repository. For your Gradle build:

	compile 'org.keeber:simple-img:+'

Quickstart

Read an image from an inputstream:

Image img = Image.read.from(new FileInputStream("src/test/resources/images/test.tif")), Image.Type.TIF);

Set the resolution of the image - for later writing to the image:

img.setResolution(300);

Clear the XMP data from the incoming image. Then add our own custom namespace and add a value to it:

XMPMeta m = img.clearXMP();
Image.metadata.registerNS("http://namespace.keeber.org/test", "tst");
m.setProperty("http://namespace.keeber.org/test", "property1", "value1");
//Set some common properties: such as the rating.
m.setProperty(XMPConst.NS_DC, "title", "This is the title.");
m.setProperty(XMPConst.NS_XMP, "Rating", "5");

Save the image as a new type to an output stream:

img.write.to(new FileOutputStream("build/images/test_out.jpg"), Image.Type.JPG);

Do some edits to the raster - here we place the image on a 500px square new image:

img.normalize(false).edit.place(500, 500);

TO-DO

  1. Resolution (reading) for JPEG files, ICC profile (reading) for PNG.
  2. Figure out a prettier way of chaining and doing the edits.
  3. Support for reading and writing CMYK images.

Versions

Version
0.0.6
0.0.5
0.0.4
0.0.3