Questions tagged [juicy-pixels]

JuicyPixels is a haskell library used to load and store images in PNG,Bitmap, Jpeg, Radiance, Tiff and Gif images.

JuicyPixels is a haskell library used to load and store images in PNG,Bitmap, Jpeg, Radiance, Tiff and Gif images.

http://hackage.haskell.org/package/JuicyPixels

15 questions
6
votes
1 answer

How to find mp4 metadata with ffmpeg-light in haskell?

I'm using ffmpeg-light, JuicyPixels and gloss to display a video with Haskell. I want to find the metadata of videos I'm playing automatically, but I have not yet found a way to do so. I would like to access metadata like the resolution and the…
user5696316
4
votes
1 answer

Why doesn't Gloss render in native resolution?

On OSX (with 2560 x 1600 native resolution), Gloss displays everything at zoom-factor 2x. Giving a window size of 300 x 300 to the display function creates a window of 600 x 600. All content in that window is also twice as big (in each dimension),…
Merzhase
  • 61
  • 6
4
votes
1 answer

Haskell - Converting multiple images into a video file - ffmpeg-lights' frameWriter-function fails

Situation Currently I am working on an application for image-processing that uses ffmpeg-light to fetch all the frames of a given video-file so that the program afterwards can apply grayscaling, as well as edge detection alogrithms to each of the…
oRole
  • 1,316
  • 1
  • 8
  • 24
4
votes
1 answer

Haskell - Turning multiple image-files into one video-file using the ffmpeg-light package

Background I wrote an application for image-processing which uses the ffmpeg-light package to fetch all the frames of a given video-file so that the program afterwards is able to apply grayscaling, as well as edge detection alogrithms to each of the…
oRole
  • 1,316
  • 1
  • 8
  • 24
3
votes
1 answer

How to extract RGB values from (most) pictures?

I want to extract every RGB value from possible pictures in Haskell. What would be the easiest way to get the raw values (0-255)? I already got some results with the Juicy Pixels library, but somehow I always get the exception: *** Exception:…
Cirquit
  • 464
  • 2
  • 9
3
votes
1 answer

how do I write pixels with JuicyPixels? (in ST monad)

I'd like to write some pixels into an image, and write the image to disk. I've been following the advice I've heard from many Haskellers to follow the type signatures, and essentially play "type tetris" until I get where I'm going. Its mostly…
nont
  • 9,322
  • 7
  • 62
  • 82
2
votes
1 answer

How to use Either String (IO())

I'm working with Juicy Pixels library in Haskell and i want to make a GIF animation with a list of image PixelRGB8. There's a function that do that (writeGifAnimation), but it returns a type that i don't know how to use (Either String (IO())). Can…
2
votes
1 answer

How to convert precision in Image type from Double to Word8 using HIP?

I have an image in the type Image VS Y Double (after using function readImageY from HIP library) and I want to convert it to Image VS Y Word8. How should I go about doing this? I need to have it in this precision for the next function I am applying…
FifthCode
  • 65
  • 6
1
vote
1 answer

Space Leak on Gloss render of Mutable Image

I used the JuicyPixel library for generating a rendered image and the gloss library for a live preview. The piece of code below causes a Space Leak viewportRenderer :: Viewport Picture viewportRenderer = do eventText <- Color [rgb|#FFFFFF|] .…
Perigord
  • 111
  • 6
1
vote
1 answer

How to convert an image from DynamicImage type to Image arr cs e? Using JuicyPixels and HIP libraries

I am using the JuicyPixels image processing library to ingest an image and convert it into a Matrix type. I want to change the resolution of the image to a user specified dimension, so I can feed it into a neural network. My program so far reads an…
1
vote
2 answers

IO (Maybe Picture) -> Picture

I'm creating a game with Gloss. I have this function : block :: IO (Maybe Picture) block = loadJuicyPNG "block.png" How do I take this IO (Maybe Picture) and turn it into a Picture?
1
vote
1 answer

JuicyPixels can't load PNG files

I'm trying to learn how load, modify and save images using JuicyPixels version 3.2.5.1. I have the following code: {-# LANGUAGE OverloadedStrings #-} import Codec.Picture imageCreator :: String -> IO () imageCreator path = writePng path $…
Matt
  • 3,651
  • 3
  • 16
  • 35
1
vote
2 answers

OpenGL texture contains bad data - what's going on?

I am trying to load an image into OpenGL texture. I created a window and GL 4.4 Core Forward-Compatible context: Here's the code I'm using to load the image and create the texture: load :: IO () load = do image <- JP.readImage "image.png" …
Bartek Banachewicz
  • 38,596
  • 7
  • 91
  • 135
1
vote
1 answer

How to load an OpenGL texture with the JuicyPixels library in Haskell

Can you provide me with an example on how to load a texture with texImage2D (from OpenGL) and readImage (from the JuicyPixels library) in Haskell? I know there is already a similar question here but cause I'm a newbie, I'm not been able to make that…
Manuel
  • 27
  • 4
0
votes
2 answers

Pick a specific picture from a list

I have the following function: blockToPicture :: Int -> [Picture] -> Picture blockToPicture n [pic1,pic2,pic3] | n==0 = ... | n==1 = ... | otherwise = ... If n==0 I want to select…