YMa-lab / CARD

GNU General Public License v3.0
94 stars 21 forks source link

image coordinates and title size #65

Closed chrkuo closed 6 months ago

chrkuo commented 7 months ago

is there anyway to adjust the deconvoluted imaging orientation? and the size of the banner

krigia commented 7 months ago

@chrkuo You can try to adjust imaging orientation with magick package

Read the image

image <- image_read("path/to/image.jpg")

Rotate the image (adjust the angle as needed)

img_rotated <- image_rotate(image, angle = 90)

Display the rotated image

image_display(img_rotated)

krigia commented 7 months ago

@chrkuo For adjusting the size of a banner in R, it depends on the context. If you're creating a banner for a plot or visualization, you can adjust the size using the parameters of the plotting functions (e.g., ggplot2). library(ggplot2)

Create a plot with a specific size

plot <- ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point()

Save the plot with a specific size

ggsave("plot.png", plot = plot, width = 10, height = 5, units = "in")

If you're working with images, you can resize them using the magick package:

Read the image

image <- image_read("path/to/image.jpg")

Resize the image

image_resized <- image_scale(image, "500x300")

Display the resized image

image_display(image_resized)

YMalab commented 7 months ago

Hi @krigia,

Thank you for providing your solution, which is very helpful!

Best, Ying