rasterizing

C# import of Adobe Illustrator (.AI) files render to Bitmap?

六月ゝ 毕业季﹏ 提交于 2019-12-03 09:44:55
Anyone knows how to load a .AI file (Adobe Illustrator) and then rasterize/render the vectors into a Bitmap so I could generate eg. a JPG or PNG from it? I would like to produce thumbnails + render the big version with transparent background in PNG if possible. Ofcause its "possible" if you know the specs of the .AI, but has anyone any knowledge or code to share for a start? or perhaps just a link to some components? C# .NET please :o) Code is most interesting as I know nothing about reading vector points and drawing splines. Well, if Gregory is right that ai files are pdf-compatible, and you

Replacing vector images in a PDF with raster images

守給你的承諾、 提交于 2019-12-03 03:10:18
问题 Is there any easy (scriptable) way to convert a PDF with vector images into a PDF with raster images? In other words, I want to generate a PDF with the exact same (un-rasterized) text but with each vector image replaced with a rasterized version. I occasionally read PDFs of technical articles on my Kindle, and have found that reading a PDF directly is frustrating. Thankfully, Amazon's automatic conversion of PDFs to the Kindle format does a good job of reflowing the text portions of most of

When should I set layer.shouldRasterize to YES

别来无恙 提交于 2019-12-03 00:29:42
问题 I've seen fixes for some lagyness issues by setting the layer property of the view view.layer.shouldRasterize = YES; I saw a great difference in performance when using a UICollectionView and preparing the cells and setting the propery. Not sure what the implications are. Would be great to get an explanation. Thanks! 回答1: In WWDC 2012 Polishing Your Interface Rotations video (paid developer subscription needed), they talk about the advantages and implications of rasterizing layers. This video

Replacing vector images in a PDF with raster images

旧巷老猫 提交于 2019-12-02 16:40:24
Is there any easy (scriptable) way to convert a PDF with vector images into a PDF with raster images? In other words, I want to generate a PDF with the exact same (un-rasterized) text but with each vector image replaced with a rasterized version. I occasionally read PDFs of technical articles on my Kindle, and have found that reading a PDF directly is frustrating. Thankfully, Amazon's automatic conversion of PDFs to the Kindle format does a good job of reflowing the text portions of most of PDFs I have tried. However, while raster images seem to make it through the conversion process fine,

Shapefile to raster conversion in R?

二次信任 提交于 2019-12-01 04:06:16
I have a shapefile downloaded from the worldwildlife.org for the terrestrial ecoregions of the world. The file can be loaded here: http://worldwildlife.org/publications/terrestrial-ecoregions-of-the-world . It comes as a standard shape file and I would like to do two things with it. First: take the shapefile from my local directory and clip it to an extent of eastern North America (ext= extent (-95, -50, 24, 63)) # Read shapefile using package "maptools" eco_shp <- readShapeLines("F:/01_2013/Ecoregions/Global/wwf_terr_ecos.shp", proj4string=CRS("+proj=utm +zone=33 +datum=WGS84")) # Set the

Rasterise ggplot images in R for tikzdevice

北城以北 提交于 2019-11-29 14:34:59
I use R to analyse data, ggplot to create plots, tikzDevice to print them and finally latex to create a report. THe problem is that large plots with many points fail due to the memory limit of latex. I found here https://github.com/yihui/tikzDevice/issues/103 a solution that rasterises the plot before printing the tikz file, which allows printing the points and the text individually. require(png) require(ggplot2) require(tikzDevice) ## generate data n=1000000; x=rnorm(n); y=rnorm(n) ## first try primitive tikz("test.tex",standAlone=TRUE) plot(x,y) dev.off() ## fails due to memory system(

Rasterizing a 2D polygon

巧了我就是萌 提交于 2019-11-28 09:22:18
I need to create a binary bitmap from a closed 2D polygon represented as a list of points. Could you please point me to efficient and sufficiently simple algorithms to do that, or, even better, some C++ code? Thanks a lot! PS: I would like to avoid adding a dependency to my project. However if you suggest an open-source library, I can always look at the code, so it can be useful too. plinth The magic google phrase you want is either "non-zero winding rule" or "even odd polygon fill". See the wikipedia entries for: non-zero winding rule even odd polygon fill Both are very easy to implement and

Rasterise ggplot images in R for tikzdevice

余生颓废 提交于 2019-11-28 08:44:13
问题 I use R to analyse data, ggplot to create plots, tikzDevice to print them and finally latex to create a report. THe problem is that large plots with many points fail due to the memory limit of latex. I found here https://github.com/yihui/tikzDevice/issues/103 a solution that rasterises the plot before printing the tikz file, which allows printing the points and the text individually. require(png) require(ggplot2) require(tikzDevice) ## generate data n=1000000; x=rnorm(n); y=rnorm(n) ## first

C++ triangle rasterization

可紊 提交于 2019-11-28 07:50:42
I'm trying to fix this triangle rasterizer, but cannot make it work correctly. For some reason it only draws half of the triangles. void DrawTriangle(Point2D p0, Point2D p1, Point2D p2) { Point2D Top, Middle, Bottom; bool MiddleIsLeft; if (p0.y < p1.y) // case: 1, 2, 5 { if (p0.y < p2.y) // case: 1, 2 { if (p1.y < p2.y) // case: 1 { Top = p0; Middle = p1; Bottom = p2; MiddleIsLeft = true; } else // case: 2 { Top = p0; Middle = p2; Bottom = p1; MiddleIsLeft = false; } } else // case: 5 { Top = p2; Middle = p0; Bottom = p1; MiddleIsLeft = true; } } else // case: 3, 4, 6 { if (p0.y < p2.y) //

Turn a MATLAB plot into image

拜拜、爱过 提交于 2019-11-27 09:33:11
I have generated a plot like figure; hold; axis([0 10 0 10]); fill([ 1 1 5 5], [5 1 1 5],'b') and now I want to have this plot as an matrix so that I can i.e. filter the blog with a gaussian. Googleing I found this thread Rasterizing Plot to Image at MATLAB Central. I tried it, but I could only get it to work for line or function plots. Do you have any ideas? You can use GETFRAME function. It returns movie frame structure, which is actually rasterized figure. Field cdata will contain your matrix. F=getframe; figure(2) imagesc(F.cdata); High Performance Mark What are the desired characteristics