rasterize

Blank PNG / Tainted canvases may not be exported (not using images)

左心房为你撑大大i 提交于 2019-12-02 04:10:25
问题 I am trying to export a fairly simple html to canvas and then png. To do so, I am using rasterizeHTML (http://cburgmer.github.io/rasterizeHTML.js/). The problem that I am facing is that I get a warning like if I was loading an external image/resource, but I am not. This is what I have tried: HTML: <canvas height="500" width="500" id="rasterizer"></canvas> Javascript var canvas=document.getElementById("rasterizer"); rasterizeHTML.drawHTML('<div width="300px" height="300px" > <div style="width:

Blank PNG / Tainted canvases may not be exported (not using images)

ε祈祈猫儿з 提交于 2019-12-02 00:24:17
I am trying to export a fairly simple html to canvas and then png. To do so, I am using rasterizeHTML ( http://cburgmer.github.io/rasterizeHTML.js/ ). The problem that I am facing is that I get a warning like if I was loading an external image/resource, but I am not. This is what I have tried: HTML: <canvas height="500" width="500" id="rasterizer"></canvas> Javascript var canvas=document.getElementById("rasterizer"); rasterizeHTML.drawHTML('<div width="300px" height="300px" > <div style="width: 200px;height: 200px;position: absolute;top: 50%;left: 50%;margin: -100px 0 0 -100px;"><div style=

PHP + PhantomJS Rasterize

ぃ、小莉子 提交于 2019-12-01 22:46:16
I'm using PhantomJS 64 bit in my PHP application to dynamically capture an HTML page to be emailed to the user. phantomjs rasterize.js "http://..." /path_to_images/image.png This method works fine when I run the above on the command line but when the PHP script runs the command using exec it fails with no output and returns exit code 11. If I switch it to use the 32 bit phantomJS binary, the command succeeds but fails to load the google JSAPI on the page since with error Reference Error: can't find variable google . This is a problem because not all of the page content is loaded and captured

gdal 2.1 Rasterize

笑着哭i 提交于 2019-12-01 18:29:53
Is it possible to set the data type (Byte, Float32) when using gdal.Rasterize in gdal 2.1? Currently, I use gdal.Translate to convert to Byte, but this is inefficient. tif = my/target.tif shp = my/source.shp tiftemp = my/temp/solution.tif rasterizeOptions = gdal.RasterizeOptions(xRes=20, yRes=20, allTouched=True etc.) gdal.Rasterize(tiftemp, shp, options=rasterizeOptions) #translate to Byte data type (not supported by Rasterize?) gdal.Translate(tif, tiftemp, outputType=gdal.GDT_Byte, creationOptions=['COMPRESS=PACKBITS') I am aware that it is possible to use subprocess.check_call('gdal

algorithm to rasterize and fill a hypersphere?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 16:17:34
I'm trying to rasterize and fill a hypersphere. In essence, I have a d-dimensional grid of fixed size and a sphere (center, radius) and want to find out which cells of the grid overlap with the sphere and store their coordinates. I am aware of the Midpoint circle algorithm which takes advantage of 8-way mirroring and produces the outer cells (border) of a circle. I have also altered the linked wikipedia code so as to fill the circle (that is, to produce the coordinates of all cells inside the border). However I am unaware of any algorithms for higher dimension. For example in 4d, I've been

algorithm to rasterize and fill a hypersphere?

回眸只為那壹抹淺笑 提交于 2019-11-26 18:35:16
问题 I'm trying to rasterize and fill a hypersphere. In essence, I have a d-dimensional grid of fixed size and a sphere (center, radius) and want to find out which cells of the grid overlap with the sphere and store their coordinates. I am aware of the Midpoint circle algorithm which takes advantage of 8-way mirroring and produces the outer cells (border) of a circle. I have also altered the linked wikipedia code so as to fill the circle (that is, to produce the coordinates of all cells inside the

how to rasterize rotated rectangle (in 2d by setpixel)

纵然是瞬间 提交于 2019-11-26 01:09:27
问题 I have got a four 2d vertices A B C D of rotated rectangle, I need to rasterize/draw it (efficiently) in pixelbufer with setpixel(x,y,color) how to do it? i was trying with some code like // convertilg a b c d do up down left right, // calculating some dx_left dx_right on y-- // etc (frustrating on special cases when there are 2 up_y vertices in same line etc) for(;;) { drawhorizontalline(y, xstart, xend, color); if(y==downy) break; y--; xstart+=dxstart; xend+=dxend; if(y==lefty) dxstart =