Extract data from a PNG/TIFF

Sometimes it’s useful to be able to extract data from a published figure. If the figure isn’t a vector based format (for which the numeric data is probably still in the file), it’s possible to digitize the image with R, click the points and extract it that way. The digitize package is simple to use for this purpose…

If you save the top figure from here to a PNG called “Fig2a_Kreners2015� in your working directory, you can digitize the three lines and replicate the figure (or do other stuff if you so wish) as follows

Easy huh? It just gets a bit laborious with many points…

Related