Skip to content

Commit

Permalink
update a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
privefl committed Oct 24, 2024
1 parent 642a6f5 commit a3188a9
Show file tree
Hide file tree
Showing 22 changed files with 157 additions and 163 deletions.
3 changes: 1 addition & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
^update-webshot\.R$
^tmp-tests$
^kongs\.png$
^\.travis\.yml$
^appveyor\.yml$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
52 changes: 52 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: pixelart
Title: Make Pixel Art Models From Pictures
Version: 0.2.0
Date: 2018-08-01
Title: Resize Images and Make Pixel Art Models From Pictures
Version: 0.2.1
Date: 2024-10-24
Authors@R:
person("Florian", "Privé",
email = "[email protected]",
role = c("aut", "cre"))
Description: Make Pixel Art models from pictures.
Description: Resize and crop images, and make Pixel Art models from pictures (Shiny app).
Depends: R (>= 3.3.0)
Imports:
flexclust,
Expand All @@ -19,8 +19,7 @@ Imports:
stringr
License: GPL-3
Encoding: UTF-8
LazyData: true
URL: https://privefl.github.io/pixelart
BugReports: https://github.com/privefl/pixelart/issues
RoxygenNote: 6.1.0
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
4 changes: 2 additions & 2 deletions R/downsize.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#' Downsize an image
#'
#' @inheritParams pixelart
#' @inheritParams pixelart-package
#' @param npixel_width Number of pixels for the width of the image.
#'
#' @return An image object of package **Magick** of reduced or equal size.
Expand All @@ -22,7 +22,7 @@ downsize <- function(im, npixel_width = 200) {

#' Crop image
#'
#' @inheritParams pixelart
#' @inheritParams pixelart-package
#' @param left Number of pixels to crop to the left
#' @param top Number of pixels to crop to the top
#' @param right Number of pixels to crop to the right
Expand Down
4 changes: 2 additions & 2 deletions R/kmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#' Perform K-means on RGB colors
#'
#' @inheritParams pixelart
#' @inheritParams pixelart-package
#' @param ncolors Number of colors (clusters). Default is 8.
#'
#' @return An object of class *kcca* of package **flexclust**.
Expand All @@ -28,7 +28,7 @@ kmeans_colors <- function(im, ncolors = 8) {
#'
#' Get projection on kmeans for colors of image.
#'
#' @inheritParams pixelart
#' @inheritParams pixelart-package
#' @param kmeans An object of class *kcca* of package **flexclust**.
#'
#' @return A matrix of colors (in hex format, e.g. "#ffffff").
Expand Down
11 changes: 6 additions & 5 deletions R/pixelart-package.r
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
################################################################################

#' pixelart.
#' @param im An image object of package magick.
#'
#' @param im An image object of package **Magick**.
#'
#' @name pixelart
#' @docType package
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
## usethis namespace: end
NULL

################################################################################
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[![Travis build status](https://travis-ci.org/privefl/pixelart.svg?branch=master)](https://travis-ci.org/privefl/pixelart)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/privefl/pixelart?branch=master&svg=true)](https://ci.appveyor.com/project/privefl/pixelart)
[![CRAN status](https://www.r-pkg.org/badges/version/pixelart)](https://cran.r-project.org/package=pixelart)
<!-- badges: start -->
[![R-CMD-check](https://github.com/privefl/pixelart/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/privefl/pixelart/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/pixelart)](https://CRAN.R-project.org/package=pixelart)
<!-- badges: end -->

# R package {pixelart}

R Package to make Pixel Art models. [[Blog post introducing the package]](https://privefl.github.io/blog/shiny-app-for-making-pixel-art-models/)
R Package to to resize and crop images, and make Pixel Art models from your own pictures. [[Blog post introducing the package]](https://privefl.github.io/blog/shiny-app-for-making-pixel-art-models/)

```r
# Installation
devtools::install_github("privefl/pixelart")
# Installation from CRAN
install.packages("pixelart")

# Installation from GitHub
remotes::install_github("privefl/pixelart")

# Run Shiny app for pixel art models
pixelart::run_pixelart()
Expand All @@ -29,6 +33,8 @@ I present you Kong. **A.** Picture of Kong. **B.** Kong as a pixel art model, cr

## News

- October 24, 2024: release on CRAN

- August 1, 2018: add Shiny app for resizing images.

- March 10, 2018: run kmeans in the Lab space (instead of the RGB space)
Expand Down
45 changes: 0 additions & 45 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion inst/shiny/resize/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ server <- function(input, output, session) {
glue::glue("Current size: {infos$width} x {infos$height}")
})

output$img <- renderImage({
output$img <- renderImage(deleteFile = TRUE, {

image_write(image_with_border(), tmp_jpg, format = "jpg")

Expand Down
2 changes: 1 addition & 1 deletion man/colors_kmeans.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/crop.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/downsize.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/kmeans_colors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions man/pipeline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/pixelart-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions man/pixelart.Rd

This file was deleted.

4 changes: 2 additions & 2 deletions man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a3188a9

Please sign in to comment.