Copyright | (c) Alexey Kuleshevich 2017 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Graphics.Image.ColorSpace
Contents
Description
- data family Pixel cs e :: *
- toPixelY :: ToY cs e => Pixel cs e -> Pixel Y Double
- toImageY :: (ToY cs e, Array arr cs e, Array arr Y Double) => Image arr cs e -> Image arr Y Double
- toPixelYA :: ToYA cs e => Pixel cs e -> Pixel YA Double
- toImageYA :: (ToYA cs e, Array arr cs e, Array arr YA Double) => Image arr cs e -> Image arr YA Double
- toPixelRGB :: ToRGB cs e => Pixel cs e -> Pixel RGB Double
- toImageRGB :: (ToRGB cs e, Array arr cs e, Array arr RGB Double) => Image arr cs e -> Image arr RGB Double
- toPixelRGBA :: ToRGBA cs e => Pixel cs e -> Pixel RGBA Double
- toImageRGBA :: (ToRGBA cs e, Array arr cs e, Array arr RGBA Double) => Image arr cs e -> Image arr RGBA Double
- toPixelHSI :: ToHSI cs e => Pixel cs e -> Pixel HSI Double
- toImageHSI :: (ToHSI cs e, Array arr cs e, Array arr HSI Double) => Image arr cs e -> Image arr HSI Double
- toPixelHSIA :: ToHSIA cs e => Pixel cs e -> Pixel HSIA Double
- toImageHSIA :: (ToHSIA cs e, Array arr cs e, Array arr HSIA Double) => Image arr cs e -> Image arr HSIA Double
- toPixelCMYK :: ToCMYK cs e => Pixel cs e -> Pixel CMYK Double
- toImageCMYK :: (ToCMYK cs e, Array arr cs e, Array arr CMYK Double) => Image arr cs e -> Image arr CMYK Double
- toPixelCMYKA :: ToCMYKA cs e => Pixel cs e -> Pixel CMYKA Double
- toImageCMYKA :: (ToCMYKA cs e, Array arr cs e, Array arr CMYKA Double) => Image arr cs e -> Image arr CMYKA Double
- toPixelYCbCr :: ToYCbCr cs e => Pixel cs e -> Pixel YCbCr Double
- toImageYCbCr :: (ToYCbCr cs e, Array arr cs e, Array arr YCbCr Double) => Image arr cs e -> Image arr YCbCr Double
- toPixelYCbCrA :: ToYCbCrA cs e => Pixel cs e -> Pixel YCbCrA Double
- toImageYCbCrA :: (ToYCbCrA cs e, Array arr cs e, Array arr YCbCrA Double) => Image arr cs e -> Image arr YCbCrA Double
- toPixelBinary :: ColorSpace cs e => Pixel cs e -> Pixel X Bit
- fromPixelBinary :: Pixel X Bit -> Pixel Y Word8
- toImageBinary :: (Array arr cs e, Array arr X Bit) => Image arr cs e -> Image arr X Bit
- fromImageBinary :: (Array arr X Bit, Array arr Y Word8) => Image arr X Bit -> Image arr Y Word8
- newtype Bit = Bit Word8
- on :: Pixel X Bit
- off :: Pixel X Bit
- isOn :: Pixel X Bit -> Bool
- isOff :: Pixel X Bit -> Bool
- fromBool :: Bool -> Pixel X Bit
- zero :: Bit
- one :: Bit
- bit2bool :: Bit -> Bool
- bool2bit :: Bool -> Bit
- toNum :: Num a => Bit -> a
- fromNum :: (Eq a, Num a) => a -> Bit
- data Complex a :: * -> * = ~a :+ ~a
- (+:) :: Applicative (Pixel cs) => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e)
- realPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- imagPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- mkPolar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e)
- cis :: (Applicative (Pixel cs), RealFloat e) => Pixel cs e -> Pixel cs (Complex e)
- polar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> (Pixel cs e, Pixel cs e)
- magnitude :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- phase :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- conjugate :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs (Complex e)
- squashWith :: (Array arr cs e, Array arr X b) => (b -> e -> b) -> b -> Image arr cs e -> Image arr X b
- squashWith2 :: (Array arr cs e, Array arr X b) => (b -> e -> e -> b) -> b -> Image arr cs e -> Image arr cs e -> Image arr X b
- toPixelsX :: ColorSpace cs e => Pixel cs e -> [Pixel X e]
- fromPixelsX :: ColorSpace cs e => [(cs, Pixel X e)] -> Pixel cs e
- toImagesX :: (Array arr cs e, Array arr X e) => Image arr cs e -> [Image arr X e]
- fromImagesX :: (Array arr X e, Array arr cs e) => [(cs, Image arr X e)] -> Image arr cs e
- eqTolPx :: (ColorSpace cs e, Ord e) => e -> Pixel cs e -> Pixel cs e -> Bool
- data Y = LumaY
- data YA
- class ColorSpace cs e => ToY cs e where
- class ToY cs e => ToYA cs e where
- data RGB
- data RGBA
- class ColorSpace cs e => ToRGB cs e where
- class ToRGB cs e => ToRGBA cs e where
- data HSI
- data HSIA
- class ColorSpace cs e => ToHSI cs e where
- class ToHSI cs e => ToHSIA cs e where
- data CMYK
- data CMYKA
- class ColorSpace cs e => ToCMYK cs e where
- class ToCMYK cs e => ToCMYKA cs e where
- data YCbCr
- data YCbCrA
- class ColorSpace cs e => ToYCbCr cs e where
- class ToYCbCr cs e => ToYCbCrA cs e where
- data X = X
- toWord8I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word8) => Image arr cs e -> Image arr cs Word8
- toWord16I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word16) => Image arr cs e -> Image arr cs Word16
- toWord32I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word32) => Image arr cs e -> Image arr cs Word32
- toFloatI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Float) => Image arr cs e -> Image arr cs Float
- toDoubleI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Double) => Image arr cs e -> Image arr cs Double
- toWord8Px :: (Functor (Pixel cs), Elevator e) => Pixel cs e -> Pixel cs Word8
- data Word8 :: *
- data Word16 :: *
- data Word32 :: *
- data Word64 :: *
Pixels
Family of Pixels
Pixel is a type family for all available color spaces. Below is the listed of all class instances, that pixels are installed in, as well as all pixel constructors.
>>>
:t (PixelY 0) -- Black pixel in Luma
(PixelY 0) :: Num e => Pixel Y e>>>
PixelRGB 255 0 0 :: Pixel RGB Word8 -- Red pixel in RGB
<RGB:(255|0|0)>>>>
PixelRGB 1 0 0 :: Pixel RGB Double -- Same red pixel in RGB with Double precision.
<RGB:(1.0|0.0|0.0)>>>>
(PixelRGB 255 0 0 :: Pixel RGB Word8) == (toWord8 <$> (PixelRGB 1 0 0 :: Pixel RGB Double))
True
A Pixel family with a color space and a precision of elements.
Instances
Luma (gray scale)
Conversion to Luma from other color spaces.
toImageY :: (ToY cs e, Array arr cs e, Array arr Y Double) => Image arr cs e -> Image arr Y Double #
Convert an image to Luma image.
toImageYA :: (ToYA cs e, Array arr cs e, Array arr YA Double) => Image arr cs e -> Image arr YA Double #
Convert an image to Luma image with Alpha.
RGB
Conversion to RGB from other color spaces.
toImageRGB :: (ToRGB cs e, Array arr cs e, Array arr RGB Double) => Image arr cs e -> Image arr RGB Double #
Convert to an RGB
image.
toImageRGBA :: (ToRGBA cs e, Array arr cs e, Array arr RGBA Double) => Image arr cs e -> Image arr RGBA Double #
Convert to an RGBA
image.
HSI
Conversion to HSI from other color spaces.
toImageHSI :: (ToHSI cs e, Array arr cs e, Array arr HSI Double) => Image arr cs e -> Image arr HSI Double #
Convert to an HSI
image.
toImageHSIA :: (ToHSIA cs e, Array arr cs e, Array arr HSIA Double) => Image arr cs e -> Image arr HSIA Double #
Convert to an HSIA
image.
CMYK
Conversion to CMYK from other color spaces.
toImageCMYK :: (ToCMYK cs e, Array arr cs e, Array arr CMYK Double) => Image arr cs e -> Image arr CMYK Double #
Convert to a CMYK
image.
toImageCMYKA :: (ToCMYKA cs e, Array arr cs e, Array arr CMYKA Double) => Image arr cs e -> Image arr CMYKA Double #
Convert to a CMYKA
image.
YCbCr
Conversion to YCbCr from other color spaces.
toImageYCbCr :: (ToYCbCr cs e, Array arr cs e, Array arr YCbCr Double) => Image arr cs e -> Image arr YCbCr Double #
Convert to an YCbCr
image.
toImageYCbCrA :: (ToYCbCrA cs e, Array arr cs e, Array arr YCbCrA Double) => Image arr cs e -> Image arr YCbCrA Double #
Convert to an YCbCrA
image.
Binary
This is a Binary colorspace, pixel's of which can be created using these constructors:
on
- Represents value
1
orTrue
. It's a foreground pixel and is displayed in black. off
- Represents value
0
orFalse
. It's a background pixel and is displayed in white.
Note, that values are inverted before writing to or reading from file, since
grayscale images represent black as a 0
value and white as 1
on a
[0,1]
scale.
Binary pixels also behave as binary numbers with a size of 1-bit, for instance:
>>>
on + on -- equivalent to: 1 .|. 1
<Binary:(1)>>>>
(on + on) * off -- equivalent to: (1 .|. 1) .&. 0
<Binary:(0)>>>>
(on + on) - on
<Binary:(0)>
toPixelBinary :: ColorSpace cs e => Pixel cs e -> Pixel X Bit #
Convert to a Binary
pixel.
toImageBinary :: (Array arr cs e, Array arr X Bit) => Image arr cs e -> Image arr X Bit #
Convert to a Binary
image.
fromImageBinary :: (Array arr X Bit, Array arr Y Word8) => Image arr X Bit -> Image arr Y Word8 #
Convert a Binary image to Luma image
Under the hood, binary pixels are represented as Word8
, but can only take
values of 0
or 1
. Use zero
/one
to construct a bit and on
/off
to
construct a binary pixel.
Instances
Eq Bit # | |
Num Bit # | |
Ord Bit # | |
Show Bit # | |
Storable Bit # | |
Bits Bit # | |
Unbox Bit # | Unboxing of a |
Elevator Bit # | Values: |
Vector Vector Bit # | |
MVector MVector Bit # | |
ToRGBA X Bit # | |
ToRGB X Bit # | |
ToYA X Bit # | |
Readable [Image VS X Bit] (Seq PBM) # | |
Bits (Pixel X Bit) # | |
Writable (Image VS X Bit) TIF # | |
Writable (Image VS X Bit) TGA # | |
Writable (Image VS X Bit) PNG # | |
Writable (Image VS X Bit) BMP # | |
Readable (Image VS X Bit) TIF # | |
Readable (Image VS X Bit) TGA # | |
Readable (Image VS X Bit) PNG # | |
Readable (Image VS X Bit) BMP # | |
Readable (Image VS X Bit) PBM # | |
data Vector Bit # | |
data MVector s Bit # | |
Represents value True
or 1
in binary. Often also called a foreground
pixel of an object.
Complex
Rectangular form
Complex numbers are an algebraic type.
For a complex number z
,
is a number with the magnitude of abs
zz
,
but oriented in the positive real direction, whereas
has the phase of signum
zz
, but unit magnitude.
The Foldable
and Traversable
instances traverse the real part first.
Constructors
~a :+ ~a infix 6 | forms a complex number from its real and imaginary rectangular components. |
Instances
realPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e #
Extracts the real part of a complex pixel.
imagPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e #
Extracts the imaginary part of a complex pixel.
Polar form
mkPolar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e) #
Form a complex pixel from polar components of magnitude and phase.
polar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> (Pixel cs e, Pixel cs e) #
magnitude :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e #
The nonnegative magnitude of a complex pixel.
Conjugate
conjugate :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs (Complex e) #
The conjugate of a complex pixel.
X
squashWith :: (Array arr cs e, Array arr X b) => (b -> e -> b) -> b -> Image arr cs e -> Image arr X b #
Apply a left fold to each of the pixels in the image.
squashWith2 :: (Array arr cs e, Array arr X b) => (b -> e -> e -> b) -> b -> Image arr cs e -> Image arr cs e -> Image arr X b #
Combination of zipWith and simultanious left fold on two pixels at the same time.
toPixelsX :: ColorSpace cs e => Pixel cs e -> [Pixel X e] #
Separate a Pixel into a list of components with X
pixels containing every
component from the pixel.
>>>
toPixelsX (PixelRGB 4 5 6)
[<X:(4)>,<X:(5)>,<X:(6)>]
fromPixelsX :: ColorSpace cs e => [(cs, Pixel X e)] -> Pixel cs e #
Combine a list of X
pixels into a Pixel with a specified channel
order. Not the most efficient way to construct a pixel, but might prove
useful to someone.
>>>
fromPixelsX [(RedRGB, 3), (BlueRGB, 5), (GreenRGB, 4)]
<RGB:(3.0|4.0|5.0)>>>>
fromPixelsX $ zip (enumFrom RedRGB) (toPixelsX $ PixelRGB 4 5 6)
<RGB:(4.0|5.0|6.0)>
toImagesX :: (Array arr cs e, Array arr X e) => Image arr cs e -> [Image arr X e] #
Separate an image into a list of images with X
pixels containing every
channel from the source image.
>>>
frog <- readImageRGB "images/frog.jpg"
>>>
let [frog_red, frog_green, frog_blue] = toImagesX frog
>>>
writeImage "images/frog_red.png" $ toImageY frog_red
>>>
writeImage "images/frog_green.jpg" $ toImageY frog_green
>>>
writeImage "images/frog_blue.jpg" $ toImageY frog_blue
fromImagesX :: (Array arr X e, Array arr cs e) => [(cs, Image arr X e)] -> Image arr cs e #
Combine a list of images with X
pixels into an image of any color
space, by supplying an order of color space channels.
For example here is a frog with swapped BlueRGB
and GreenRGB
channels.
>>>
writeImage "images/frog_rbg.jpg" $ fromImagesX [(RedRGB, frog_red), (BlueRGB, frog_green), (GreenRGB, frog_blue)]
It is worth noting though, despite that separating image channels can be sometimes pretty useful, exactly the same effect as in example above can be achieved in a much simpler and a more efficient way:
map
(\(PixelRGB r g b) -> PixelRGB r b g) frog
ColorSpace
Operations on Pixels
Luma
Luma or brightness, which is usually denoted as Y'
.
Constructors
LumaY |
Instances
Luma with Alpha channel.
Instances
class ColorSpace cs e => ToY cs e where #
Conversion to Luma color space.
Minimal complete definition
Instances
Elevator e => ToY YCbCrA e # | |
Elevator e => ToY YCbCr e # | |
Elevator e => ToY YA e # | |
Elevator e => ToY Y e # | |
Elevator e => ToY X e # | |
Elevator e => ToY RGBA e # | |
Elevator e => ToY RGB e # | Computes Luma: |
Elevator e => ToY HSIA e # | |
Elevator e => ToY HSI e # | |
Elevator e => ToY CMYKA e # | |
Elevator e => ToY CMYK e # | |
RGB
Red, Green and Blue color space.
Instances
Red, Green and Blue color space with Alpha channel.
Instances
class ColorSpace cs e => ToRGB cs e where #
Conversion to RGB
color space.
Minimal complete definition
Instances
Elevator e => ToRGB YCbCrA e # | |
Elevator e => ToRGB YCbCr e # | |
Elevator e => ToRGB YA e # | |
Elevator e => ToRGB Y e # | |
ToRGB X Bit # | |
Elevator e => ToRGB RGBA e # | |
Elevator e => ToRGB RGB e # | |
Elevator e => ToRGB HSIA e # | |
Elevator e => ToRGB HSI e # | |
Elevator e => ToRGB CMYKA e # | |
Elevator e => ToRGB CMYK e # | |
class ToRGB cs e => ToRGBA cs e where #
Conversion to RGBA
from another color space with Alpha channel.
Instances
Elevator e => ToRGBA YCbCrA e # | |
ToRGB YCbCr e => ToRGBA YCbCr e # | |
Elevator e => ToRGBA YA e # | |
ToRGB Y e => ToRGBA Y e # | |
ToRGBA X Bit # | |
Elevator e => ToRGBA RGBA e # | |
ToRGB RGB e => ToRGBA RGB e # | |
Elevator e => ToRGBA HSIA e # | |
ToRGB HSI e => ToRGBA HSI e # | |
Elevator e => ToRGBA CMYKA e # | |
ToRGB CMYK e => ToRGBA CMYK e # | |
HSI
Hue, Saturation and Intensity color space.
Instances
Bounded HSI # | |
Enum HSI # | |
Eq HSI # | |
Show HSI # | |
ChannelColour HSI # | |
Elevator e => ColorSpace HSI e # | |
ToYCbCr HSI e => ToYCbCrA HSI e # | |
Elevator e => ToYCbCr HSI e # | |
ToCMYK HSI e => ToCMYKA HSI e # | |
Elevator e => ToCMYK HSI e # | |
ToHSI HSI e => ToHSIA HSI e # | |
Elevator e => ToHSI HSI e # | |
ToRGB HSI e => ToRGBA HSI e # | |
Elevator e => ToRGB HSI e # | |
ToY HSI e => ToYA HSI e # | |
Elevator e => ToY HSI e # | |
Functor (Pixel HSI) # | |
Applicative (Pixel HSI) # | |
Foldable (Pixel HSI) # | |
Eq e => Eq (Pixel HSI e) # | |
Show e => Show (Pixel HSI e) # | |
Storable e => Storable (Pixel HSI e) # | |
data Pixel HSI # | |
type Components HSI e # | |
Hue, Saturation and Intensity color space with Alpha channel.
Instances
Bounded HSIA # | |
Enum HSIA # | |
Eq HSIA # | |
Show HSIA # | |
ChannelColour HSIA # | |
Elevator e => AlphaSpace HSIA e # | |
Elevator e => ColorSpace HSIA e # | |
Elevator e => ToYCbCrA HSIA e # | |
Elevator e => ToYCbCr HSIA e # | |
Elevator e => ToCMYKA HSIA e # | |
Elevator e => ToCMYK HSIA e # | |
Elevator e => ToHSIA HSIA e # | |
Elevator e => ToHSI HSIA e # | |
Elevator e => ToRGBA HSIA e # | |
Elevator e => ToRGB HSIA e # | |
Elevator e => ToYA HSIA e # | |
Elevator e => ToY HSIA e # | |
Functor (Pixel HSIA) # | |
Applicative (Pixel HSIA) # | |
Foldable (Pixel HSIA) # | |
Eq e => Eq (Pixel HSIA e) # | |
Show e => Show (Pixel HSIA e) # | |
Storable e => Storable (Pixel HSIA e) # | |
type Opaque HSIA # | |
data Pixel HSIA # | |
type Components HSIA e # | |
class ColorSpace cs e => ToHSI cs e where #
Conversion to HSI
color space.
Minimal complete definition
class ToHSI cs e => ToHSIA cs e where #
Conversion to HSIA
from another color space with Alpha channel.
Instances
Elevator e => ToHSIA YCbCrA e # | |
ToHSI YCbCr e => ToHSIA YCbCr e # | |
Elevator e => ToHSIA YA e # | |
ToHSI Y e => ToHSIA Y e # | |
Elevator e => ToHSIA RGBA e # | |
ToHSI RGB e => ToHSIA RGB e # | |
Elevator e => ToHSIA HSIA e # | |
ToHSI HSI e => ToHSIA HSI e # | |
Elevator e => ToHSIA CMYKA e # | |
ToHSI CMYK e => ToHSIA CMYK e # | |
CMYK
Cyan, Magenta, Yellow and Black color space.
Instances
Bounded CMYK # | |
Enum CMYK # | |
Eq CMYK # | |
Show CMYK # | |
ChannelColour CMYK # | |
Elevator e => ColorSpace CMYK e # | |
ToYCbCr CMYK e => ToYCbCrA CMYK e # | |
Elevator e => ToYCbCr CMYK e # | |
ToCMYK CMYK e => ToCMYKA CMYK e # | |
Elevator e => ToCMYK CMYK e # | |
ToHSI CMYK e => ToHSIA CMYK e # | |
Elevator e => ToHSI CMYK e # | |
ToRGB CMYK e => ToRGBA CMYK e # | |
Elevator e => ToRGB CMYK e # | |
ToY CMYK e => ToYA CMYK e # | |
Elevator e => ToY CMYK e # | |
Functor (Pixel CMYK) # | |
Applicative (Pixel CMYK) # | |
Foldable (Pixel CMYK) # | |
Eq e => Eq (Pixel CMYK e) # | |
Show e => Show (Pixel CMYK e) # | |
Storable e => Storable (Pixel CMYK e) # | |
Writable (Image VS CMYK Double) TIF # | |
Writable (Image VS CMYK Word8) TIF # | |
Writable (Image VS CMYK Word8) JPG # | |
Writable (Image VS CMYK Word16) TIF # | |
Readable (Image VS CMYK Word8) TIF # | |
Readable (Image VS CMYK Word8) JPG # | |
Readable (Image VS CMYK Word16) TIF # | |
data Pixel CMYK # | |
type Components CMYK e # | |
Cyan, Magenta, Yellow and Black color space with Alpha channel.
Constructors
CyanCMYKA | Cyan |
MagCMYKA | Magenta |
YelCMYKA | Yellow |
KeyCMYKA | Key (Black) |
AlphaCMYKA | Alpha |
Instances
Bounded CMYKA # | |
Enum CMYKA # | |
Eq CMYKA # | |
Show CMYKA # | |
ChannelColour CMYKA # | |
Elevator e => AlphaSpace CMYKA e # | |
Elevator e => ColorSpace CMYKA e # | |
Elevator e => ToYCbCrA CMYKA e # | |
Elevator e => ToYCbCr CMYKA e # | |
Elevator e => ToCMYKA CMYKA e # | |
Elevator e => ToCMYK CMYKA e # | |
Elevator e => ToHSIA CMYKA e # | |
Elevator e => ToHSI CMYKA e # | |
Elevator e => ToRGBA CMYKA e # | |
Elevator e => ToRGB CMYKA e # | |
Elevator e => ToYA CMYKA e # | |
Elevator e => ToY CMYKA e # | |
Functor (Pixel CMYKA) # | |
Applicative (Pixel CMYKA) # | |
Foldable (Pixel CMYKA) # | |
Eq e => Eq (Pixel CMYKA e) # | |
Show e => Show (Pixel CMYKA e) # | |
Storable e => Storable (Pixel CMYKA e) # | |
type Opaque CMYKA # | |
data Pixel CMYKA # | |
type Components CMYKA e # | |
class ColorSpace cs e => ToCMYK cs e where #
Conversion to CMYK
color space.
Minimal complete definition
Instances
class ToCMYK cs e => ToCMYKA cs e where #
Conversion to CMYKA
.
Instances
Elevator e => ToCMYKA YCbCrA e # | |
ToCMYK YCbCr e => ToCMYKA YCbCr e # | |
Elevator e => ToCMYKA YA e # | |
ToCMYK Y e => ToCMYKA Y e # | |
Elevator e => ToCMYKA RGBA e # | |
ToCMYK RGB e => ToCMYKA RGB e # | |
Elevator e => ToCMYKA HSIA e # | |
ToCMYK HSI e => ToCMYKA HSI e # | |
Elevator e => ToCMYKA CMYKA e # | |
ToCMYK CMYK e => ToCMYKA CMYK e # | |
YCbCr
Color space is used to encode RGB information and is used in JPEG compression.
Constructors
LumaYCbCr | Luma component (commonly denoted as Y') |
CBlueYCbCr | Blue difference chroma component |
CRedYCbCr | Red difference chroma component |
Instances
Bounded YCbCr # | |
Enum YCbCr # | |
Eq YCbCr # | |
Show YCbCr # | |
ChannelColour YCbCr # | |
Elevator e => ColorSpace YCbCr e # | |
ToYCbCr YCbCr e => ToYCbCrA YCbCr e # | |
Elevator e => ToYCbCr YCbCr e # | |
ToCMYK YCbCr e => ToCMYKA YCbCr e # | |
Elevator e => ToCMYK YCbCr e # | |
ToHSI YCbCr e => ToHSIA YCbCr e # | |
Elevator e => ToHSI YCbCr e # | |
ToRGB YCbCr e => ToRGBA YCbCr e # | |
Elevator e => ToRGB YCbCr e # | |
ToY YCbCr e => ToYA YCbCr e # | |
Elevator e => ToY YCbCr e # | |
Functor (Pixel YCbCr) # | |
Applicative (Pixel YCbCr) # | |
Foldable (Pixel YCbCr) # | |
Eq e => Eq (Pixel YCbCr e) # | |
Show e => Show (Pixel YCbCr e) # | |
Storable e => Storable (Pixel YCbCr e) # | |
Writable (Image VS YCbCr Double) TIF # | |
Writable (Image VS YCbCr Word8) TIF # | |
Writable (Image VS YCbCr Word8) JPG # | |
Readable (Image VS YCbCr Word8) JPG # | |
data Pixel YCbCr # | |
type Components YCbCr e # | |
YCbCr color space with Alpha channel.
Constructors
LumaYCbCrA | Luma component (commonly denoted as Y') |
CBlueYCbCrA | Blue difference chroma component |
CRedYCbCrA | Red difference chroma component |
AlphaYCbCrA | Alpha component. |
Instances
Bounded YCbCrA # | |
Enum YCbCrA # | |
Eq YCbCrA # | |
Show YCbCrA # | |
ChannelColour YCbCrA # | |
Elevator e => AlphaSpace YCbCrA e # | |
Elevator e => ColorSpace YCbCrA e # | |
Elevator e => ToYCbCrA YCbCrA e # | |
Elevator e => ToYCbCr YCbCrA e # | |
Elevator e => ToCMYKA YCbCrA e # | |
Elevator e => ToCMYK YCbCrA e # | |
Elevator e => ToHSIA YCbCrA e # | |
Elevator e => ToHSI YCbCrA e # | |
Elevator e => ToRGBA YCbCrA e # | |
Elevator e => ToRGB YCbCrA e # | |
Elevator e => ToYA YCbCrA e # | |
Elevator e => ToY YCbCrA e # | |
Functor (Pixel YCbCrA) # | |
Applicative (Pixel YCbCrA) # | |
Foldable (Pixel YCbCrA) # | |
Eq e => Eq (Pixel YCbCrA e) # | |
Show e => Show (Pixel YCbCrA e) # | |
Storable e => Storable (Pixel YCbCrA e) # | |
type Opaque YCbCrA # | |
data Pixel YCbCrA # | |
type Components YCbCrA e # | |
class ColorSpace cs e => ToYCbCr cs e where #
Conversion to YCbCr
color space.
Minimal complete definition
Instances
Elevator e => ToYCbCr YCbCrA e # | |
Elevator e => ToYCbCr YCbCr e # | |
Elevator e => ToYCbCr YA e # | |
Elevator e => ToYCbCr Y e # | |
Elevator e => ToYCbCr RGBA e # | |
Elevator e => ToYCbCr RGB e # | |
Elevator e => ToYCbCr HSIA e # | |
Elevator e => ToYCbCr HSI e # | |
Elevator e => ToYCbCr CMYKA e # | |
Elevator e => ToYCbCr CMYK e # | |
class ToYCbCr cs e => ToYCbCrA cs e where #
Conversion to YCbCrA
from another color space with Alpha channel.
Instances
Elevator e => ToYCbCrA YCbCrA e # | |
ToYCbCr YCbCr e => ToYCbCrA YCbCr e # | |
Elevator e => ToYCbCrA YA e # | |
ToYCbCr Y e => ToYCbCrA Y e # | |
Elevator e => ToYCbCrA RGBA e # | |
ToYCbCr RGB e => ToYCbCrA RGB e # | |
Elevator e => ToYCbCrA HSIA e # | |
ToYCbCr HSI e => ToYCbCrA HSI e # | |
Elevator e => ToYCbCrA CMYKA e # | |
ToYCbCr CMYK e => ToYCbCrA CMYK e # | |
X
This is a single channel colorspace, that is designed to separate Gray
level values from other types of colorspace, hence it is not convertible to
or from, but rather is here to allow operation on arbirtary single channel
images. If you are looking for a true grayscale colorspace
Y
should be used instead.
Constructors
X |
Instances
Bounded X # | |
Enum X # | |
Eq X # | |
Show X # | |
ChannelColour X # | |
Elevator e => ColorSpace X e # | |
ToRGBA X Bit # | |
ToRGB X Bit # | |
ToYA X Bit # | |
Elevator e => ToY X e # | |
Monad (Pixel X) # | |
Functor (Pixel X) # | |
Applicative (Pixel X) # | |
Foldable (Pixel X) # | |
Readable [Image VS X Bit] (Seq PBM) # | |
Eq e => Eq (Pixel X e) # | |
Ord e => Ord (Pixel X e) # | |
Show e => Show (Pixel X e) # | |
Storable e => Storable (Pixel X e) # | |
Bits (Pixel X Bit) # | |
Writable (Image VS X Bit) TIF # | |
Writable (Image VS X Bit) TGA # | |
Writable (Image VS X Bit) PNG # | |
Writable (Image VS X Bit) BMP # | |
Readable (Image VS X Bit) TIF # | |
Readable (Image VS X Bit) TGA # | |
Readable (Image VS X Bit) PNG # | |
Readable (Image VS X Bit) BMP # | |
Readable (Image VS X Bit) PBM # | |
data Pixel X # | |
type Components X e # | |
Precision
Image
toWord8I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word8) => Image arr cs e -> Image arr cs Word8 #
Change image precision to Word8
.
toWord16I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word16) => Image arr cs e -> Image arr cs Word16 #
Change image precision to Word16
.
toWord32I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word32) => Image arr cs e -> Image arr cs Word32 #
Change image precision to Word32
.
toFloatI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Float) => Image arr cs e -> Image arr cs Float #
Change image precision to Float
.
toDoubleI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Double) => Image arr cs e -> Image arr cs Double #
Change image precision to Double
.
Pixel
toWord8Px :: (Functor (Pixel cs), Elevator e) => Pixel cs e -> Pixel cs Word8 #
Change pixel precision to Word8
.
Componenet
8-bit unsigned integer type
Instances
16-bit unsigned integer type
Instances
32-bit unsigned integer type
Instances
Bounded Word32 | |
Enum Word32 | |
Eq Word32 | |
Integral Word32 | |
Num Word32 | |
Ord Word32 | |
Read Word32 | |
Real Word32 | |
Show Word32 | |
Ix Word32 | |
Lift Word32 | |
Default Word32 | |
Unpackable Word32 | |
Pixel Pixel32 | |
LumaPlaneExtractable Pixel32 | |
PackeablePixel Pixel32 | |
Storable Word32 | |
Bits Word32 | |
FiniteBits Word32 | |
NFData Word32 | |
Prim Word32 | |
Unbox Word32 | |
Elt Word32 | |
Elevator Word32 # | Values between |
IArray UArray Word32 | |
Vector Vector Word32 | |
MVector MVector Word32 | |
MArray (STUArray s) Word32 (ST s) | |
type StorageType Word32 | |
type PixelBaseComponent Pixel32 | |
type PackedRepresentation Pixel32 | |
type Unsigned Word32 | |
type Signed Word32 | |
data Vector Word32 | |
data MVector s Word32 | |
64-bit unsigned integer type
Instances
Bounded Word64 | |
Enum Word64 | |
Eq Word64 | |
Integral Word64 | |
Num Word64 | |
Ord Word64 | |
Read Word64 | |
Real Word64 | |
Show Word64 | |
Ix Word64 | |
Lift Word64 | |
Default Word64 | |
Storable Word64 | |
Bits Word64 | |
FiniteBits Word64 | |
NFData Word64 | |
Prim Word64 | |
Unbox Word64 | |
Elt Word64 | |
Elevator Word64 # | Values between |
IArray UArray Word64 | |
Vector Vector Word64 | |
MVector MVector Word64 | |
MArray (STUArray s) Word64 (ST s) | |
type Unsigned Word64 | |
type Signed Word64 | |
data Vector Word64 | |
data MVector s Word64 | |