Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
reindernijhoff authored Mar 29, 2024
1 parent 31f4617 commit 2cc43a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The fast-image-sequence is a powerful package that allows you to display a sequence of images at a high frame rate on your website. It can be used to create smooth animations or video-like sequences from a series of images.

The FastImageSequence supports various options for customizing the behaviour of the image sequence, such as preloading all images, using a worker for handling tar files, and more.
The FastImageSequence supports various options for customizing the behaviour of the image sequence, such as preloading all images, using a worker to handle tar files, and more.

## Getting started

Expand Down Expand Up @@ -30,7 +30,7 @@ const options = {
tarImageURLCallback: (index) => `image${index}.jpg`,

// Note that you can also simultaneously use direct image loading and image loading from a tar file.
// In that case, you will use the tar file to server (super low res) preview images shown before the
// In that case, you will use the tar file to serve (super low res) preview images shown before the
// direct image loading completes.

wrap: true,
Expand All @@ -43,11 +43,11 @@ sequence.play();

In the options object, you need to set either imageURLCallback or tarImageURLCallback. **Both are optional, but at least one must be set.** If you use tarImageURLCallback, you must also load a tar file.

Normally, you will only add the tar with preview images for large image sequences. Note that you don't have to include all images in the tar. It will still work if you, for example, only include every fourth image of the sequence. This way, you can significantly reduce the size of the tar file.
Normally, you only add the tar with preview images for large image sequences. Just so you know, you don't have to include all images in the tar. It will still work if you, for example, only include every fourth sequence image. This way, you can significantly reduce the size of the tar file.

The imageURLCallback and tarImageURLCallback are functions that take an index as a parameter and return a string representing the URL of the image at that index in the sequence. This allows you to dynamically generate the URLs of your images based on their index in the sequence.

The normal usage of this library involves having a tar file with low-resolution preview images. These will be used when you randomly seek or jump in the sequence or when the internet speed is low. However, you are free to fine-tune it as you please. For example, you can also use a tar file with high-resolution images and don't set an imageURLCallback. This way, all images will be served from the tar file, which will reduce the number of requests and speed up the loading time.
The normal usage of this library involves having a tar file with low-resolution preview images. These will be used when you randomly seek or jump in the sequence or when the internet speed is low. However, you are free to fine-tune it as you please. For example, you can also use a tar file with high-resolution images and don't set an imageURLCallback. This way, all images will be served from the tar file, reducing the number of requests and speeding up the loading time.

By setting callbacks for URLs and loading the tar file yourself, you can set different functions for different devices and/or different supported image file formats. This allows you to optimize the image sequence for your specific project needs.

Expand Down Expand Up @@ -101,7 +101,7 @@ const pausedStatus = sequence.isPaused;

### progress

This is a getter and setter method that gets or sets the image sequence's current progress (0-1).
This is a getter-and-setter method that retrieves or sets the image sequence's current progress (0-1).

```typescript
// Get the progress
Expand Down

0 comments on commit 2cc43a3

Please sign in to comment.