Exporting graphs and conserving resolution, points -> pixels
daggaz
Currently, I make a map with (2048x2048) points, then scale x and y to this, starting at zero, with a step size of 1. Then I fill in my data using f(x,y). I remove the margins so the graph fills the entire window. Then I have tried various things, like setting height and width to absolute, with points as the units, and total values in both fields of 2048. Saving as a tif (no magnification, screen resolution) gives me a 2731 x 2731 image file. This is regardless of save graph file setings (same vs auto, points vs cm, etc..) I suppose I could calculate the factor and reverse it to force a mapping to 2048, but I would really like to avoid any transformations whatsoever, for peace of mind regarding my data.
I also tried using auto functions, and at one point got it to save at 1024x1024 (half my actual resolution) but im not sure anymore how I had gotten there. Either way, its still a transformation of my data.
It seems to me that IGOR is hardcoded to use my screen resolution as input, is there some way to get it to bypass this behavior? It would be preferable to just declare a resolution format, and let my OS decide actual physical viewing dimensions for the file.
Thanks,
Ian
June 20, 2012 at 05:58 am - Permalink
I am still curious about the original question, if anybody knows the answer. Simply a matter of understanding Igor and its mechanisms.
June 20, 2012 at 06:20 am - Permalink
Macro OneToOnePixels()
String graphName= WinName(0,1)
if( strlen(graphName) == 0 )
Abort "Need a Graph"!
endif
ModifyGraph/W=$graphName margin=-1 // no margin
DoAutoSizeImage(1,-1) // 1 pixel per image value, leave vertical flip alone. Season to taste.
End
After selecting this macro with your image plot top-most, choose Save Graphics and use Same Size.
Works here on Windows XP and Igor 6.22A.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
June 20, 2012 at 11:12 am - Permalink
June 20, 2012 at 12:40 pm - Permalink