resize the image in R

0 votes
How to resize the image in R? I want to resize the image of dim (480,217), how to do this?
Aug 6 in Data Analytics by anonymous
9 views

1 answer to this question.

0 votes

Hi, 

You can read the image using Magick package as below.

library(magick)
img = image_read("C:\\Users\\Cherukuri_Sindhu\\Downloads\\teams.jpg")

To resize the image, use image_scale() function.

img_scale = image_scale(img, "[Value]")  #for resizing width

img_scale = image_scale(img, "[xValue]")  #for resizing height

To resize both height and width, try below code - 

image_scale(image_scale(img,"[Value]"),"x[value]")

where value is either relative to parent object or fixed size values.

Value = 100% or 500 or 200%, etc.

answered Aug 6 by anonymous
• 22,030 points

Related Questions In Data Analytics

0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,550 points
44 views
0 votes
1 answer

What are the options for deploying models in production with R?

Well, I could say that the answer ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,100 points
221 views
0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,100 points
311 views
0 votes
1 answer
0 votes
1 answer

Create an animation from images in R

Create a vector with all frames required ...READ MORE

answered Aug 7 in Data Analytics by anonymous
• 22,030 points
13 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,700 points
80 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,700 points
97 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,700 points
71 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered 4 hours ago in Data Analytics by anonymous
• 22,030 points
80 views
0 votes
2 answers