public final class ColorProfiles extends Object
Standard ICC color profiles are read from system-specific locations for known operating systems.
Color profiles may be configured by placing a property-file
com/twelvemonkeys/imageio/color/icc_profiles.properties
on the classpath, specifying the full path to the profiles.
ICC color profiles are probably already present on your system, or
can be downloaded from
ICC,
Adobe or other places.
*
Example property file:
# icc_profiles.properties ADOBE_RGB_1998=/path/to/Adobe RGB 1998.icc GENERIC_CMYK=/path/to/Generic CMYK.icc
| Modifier and Type | Method and Description |
|---|---|
static ICC_Profile |
createProfile(byte[] input)
Reads an ICC Profile from the given byte array, with extra validation.
|
static ICC_Profile |
createProfileRaw(byte[] input)
Creates an ICC Profile from the given byte array, as-is, with no validation.
|
static boolean |
isCS_GRAY(ICC_Profile profile)
Tests whether an ICC color profile is equal to the default GRAY profile.
|
static boolean |
isCS_sRGB(ICC_Profile profile)
Tests whether an ICC color profile is equal to the default sRGB profile.
|
static ICC_Profile |
readProfile(InputStream input)
Reads an ICC Profile from the given input stream, with extra validation.
|
static ICC_Profile |
readProfileRaw(InputStream input)
Reads an ICC Profile from the given input stream, as-is, with no validation.
|
static ICC_Profile |
validateProfile(ICC_Profile profile)
Tests whether an ICC color profile is valid.
|
public static boolean isCS_sRGB(ICC_Profile profile)
profile - the ICC profile to test. May not be null.true if profile is equal to the default sRGB profile.IllegalArgumentException - if profile is nullColorSpace.CS_sRGB,
ColorSpace.isCS_sRGB()public static boolean isCS_GRAY(ICC_Profile profile)
profile - the ICC profile to test. May not be null.true if profile is equal to the default GRAY profile.IllegalArgumentException - if profile is nullColorSpace.CS_GRAYpublic static ICC_Profile validateProfile(ICC_Profile profile)
ColorConvertOp.
Note that this method only tests if a color conversion using this profile is known to fail.
There's no guarantee that the color conversion will succeed even if this method returns false.
profile - the ICC color profile. May not be null.profile if valid.IllegalArgumentException - if profile is nullCMMException - if profile is invalid.public static ICC_Profile readProfileRaw(InputStream input) throws IOException
ICC_Profile.getInstance(input).input - the input stream to read from, may not be nullICC_Profile object as read from the input stream.IOException - If an I/O error occurs while reading the stream.IllegalArgumentException - If input is null
or the stream does not contain valid ICC Profile data.ICC_Profile.getInstance(InputStream),
readProfile(InputStream)public static ICC_Profile readProfile(InputStream input) throws IOException
input - the input stream to read from, may not be nullICC_Profile object as read from the input stream.IOException - If an I/O error occurs while reading the stream.IllegalArgumentException - If input is null
or the stream does not contain valid ICC Profile data.ICC_Profile.getInstance(InputStream)public static ICC_Profile createProfileRaw(byte[] input)
ICC_Profile.getInstance(input),
except that extraneous bytes at the end of the array is ignored.input - the byte array to create a profile from, may not be nullICC_Profile object created from the byte arrayIllegalArgumentException - If input is null
or the byte array does not contain valid ICC Profile data.ICC_Profile.getInstance(byte[]),
createProfile(byte[])public static ICC_Profile createProfile(byte[] input)
input - the byte array to create a profile from, may not be nullICC_Profile object created from the byte arrayIllegalArgumentException - If input is null
or the byte array does not contain valid ICC Profile data.ICC_Profile.getInstance(byte[])Copyright © 2024. All rights reserved.