# Collating .tif images?

**URL:** <https://discourse.processing.org/t/collating-tif-images/7401>\
**Category:** Coding Questions\
**Created:** [January 10, 2019, 11:24pm UTC](https://discourse.processing.org/t/collating-tif-images/7401 "2019-01-10T23:24:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bluu](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@Bluu](https://discourse.processing.org/u/Bluu)\
**Post date:** [January 10, 2019, 11:24pm UTC](https://discourse.processing.org/t/collating-tif-images/7401/1 "2019-01-10T23:24:40Z")

</div>

I have a script I’m using to capture frames(I made it simpler for understandability’s sake here, so I can’t change it, sorry ☹ ). I’ve used the processing moviemaker tool in the past, but is there any way to use it as a library rather than a tool to collate the images in a directory to a quicktime format? Is there a better method that would save mp4(that’s what I’m looking for)?

```auto
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.Rectangle;
scap video;
Robot robot;
int cw=800, ch=600;
void setup() {
  size(800,600);
  try {
    robot = new Robot();
  }
  catch (AWTException err) {
    println(err);
  }
  video = new scap();
}
void draw() {
  PImage vi= video.get();
  image(vi, 0, 0, width, height);
}
class scap {
  PImage screenshot;
  PImage get() {
    screenshot = new PImage(robot.createScreenCapture(new Rectangle(0, 0, cw, ch)));
    return screenshot;
  }
}

```

EDIT: Forgot to add, the images save to the same dir as the pde file, I neglected to actually put saveframe in here because it was part of another function (oh well…)

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 11, 2019, 10:21am UTC](https://discourse.processing.org/t/collating-tif-images/7401/2 "2019-01-11T10:21:06Z")

</div>

I don’t know of any library that converts straight to MP4. But, as an automatable alternative, you could save all of your images into a folder, and then tell Processing to launch an external executable like `ffmpeg` and direct it to the folder that contains your images.  
What operating system are you on?

---

<div class="post-metadata">

**Author:** ![Bluu](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@Bluu](https://discourse.processing.org/u/Bluu)\
**Post date:** [January 11, 2019, 4:02pm UTC](https://discourse.processing.org/t/collating-tif-images/7401/3 "2019-01-11T16:02:22Z")

</div>

windows 10, but would prefer something that dosen’t require an external program(I’d be willing to export in a different format if it means I could keep it internal)

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 11, 2019, 4:38pm UTC](https://discourse.processing.org/t/collating-tif-images/7401/4 "2019-01-11T16:38:54Z")

</div>

Oh.  
I suggest searching on the internet for Java libraries that convert to MP4. Then, you can import it as a library into Processing and probably do the thing, cross-platform.  
Also, since `PImage` is a format of Processing, without some work such libraries would need you to save your images into files though, and then convert the folder to .mp4.

Good luck!
