Package 'colorizer'

Title: Colorize Old Images Using the 'DeOldify' Image Colorization API
Description: Call the 'DeOldify' <https://github.com/jantic/DeOldify> image colorization API on 'DeepAI'<https://deepai.org/machine-learning-model/colorizer> to colorize black and white images.
Authors: David Zumbach [aut, cre]
Maintainer: David Zumbach <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-03-08 05:01:40 UTC
Source: https://github.com/zumbov2/colorizer

Help Index


Save Colorized and Juxtaposed Images

Description

clsave saves images that have been colorized using colorize or juxtaposed with juxtapose.

Usage

clsave(response, destfile = "")

Arguments

response

a response object of a colorize function call.

destfile

a character string or vector with the name where the images are saved.

Value

Besides saving, the function returns the response object invisibly.

Examples

## Not run: 
# Save colorized images
res <- colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg")
clsave(res, destfile = "colorized_version.jpg")

## End(Not run)

Call Image Colorization API

Description

colorize calls the DeOldify image colorization API on DeepAI.

Usage

colorize(
  img,
  key = "quickstart-QUdJIGlzIGNvbWluZy4uLi4K",
  pane = c("plot", "view", "none")
)

Arguments

img

path or URL to the images to be colorized.

key

DeepAI API key.

pane

defines in which pane the image is displayed: plot, view or none.

Details

With the default API key a few queries are possible. After registration on DeepAI https://deepai.org/, around 5000 free requests are currently possible.

Value

A tibble with the file locations of the original images and the response URLs to the colorized images. The latter expire after some time. It is recommended to save the colorized images.

Examples

## Not run: 
# Call image colorization API
colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg")

## End(Not run)

colorizer package

Description

Colorize and Restore Old Images Using the 'DeOldify' Image Colorization API on 'DeepAI'

Details

See the README on GitHub


Compare Images

Description

juxtapose compares the original image with the colorized version obtained with colorize.

Usage

juxtapose(
  response,
  type = c("side-by-side", "stacked", "c-focus", "h-focus", "v-focus", "h-split",
    "v-split", "d-split", "u-animate", "s-animate"),
  pane = c("plot", "view", "none")
)

Arguments

response

a response object of a colorize function call.

type

defines the type of juxtaposition:

  • side-by-side original image left, colorized right.

  • stacked original above colorized.

  • c-focus colorized center with original image border.

  • h-focus above and below strips of original image.

  • v-focus left and right strips of original image.

  • h-split horizontally halved.

  • v-split vertically halved.

  • d-split diagonally halved.

  • u-animate animated, colorized to the top (upwards).

  • s-animate animated, colorized from left to right (sideways).

pane

defines in which pane the image is displayed: Plots or Viewer.

Value

The function adds the comparison to the response object and returns it invisibly.

Examples

## Not run: 
# Compare images
res <- colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg")
juxtapose(res)

## End(Not run)