Change style of png Graph


I am new here and new to R. :wink:

I imported a graph (saved as a jpeg) with this code line. I would now like to change the font and thickness of lines of that graph, which was imported as a jpeg file. I tried google for a few hours now but have not been successful. Thanks for your help!

img <- readJPEG("/Users/lenigruendl/Downloads/myfile.jpg", native = TRUE)

Hi, jpeg is a raster graphics format (like png, bmp etc.). Raster graphics format store information about a grid of pixel, but do not contain any direct information about text, fonts, lines etc. Means: there is no direct way to change font and thickness of lines etc. in jpg files
What you could try is to convert the jpg to a vector graphics format like svg. Vector graphics contain geometric information. However, I do not know of any package in R to convert from raster graphics format to svg (I might be wrong). But even if you could do this, what you see as text is not recognized (stored) as text by the file format (it is just geometric information). There are tools and graphic editors capable of converting jpg to a vector format and edit the geometrics. However, I am not an expert on how to do this.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.