png

Set plot margin of png plot device using par

佐手、 提交于 2020-08-07 17:12:19
问题 I've created a choropleth of Brazil. When saving the plot in .png, the upper and the lower part of the plot are lost (covered). Here are the lines to save the plot. plot.new() par(omi=c(0,0,0,0), mgp=c(0,0,0),mar=c(0,0,0,0) , family = "D") par(mfrow=c(1,1),cex=1,cex.lab = 0.75,cex.main=0.2,cex.axis=0.2) png(filename = "map_cons_g.png", width = 6,height = 6, units = "in", res = 600) plot(c(-75,-35),c(0,-30),type="n",axes=FALSE,xlab="",ylab="",asp=1.2) plot(Brazil,col=cols[Brazil$Cons.g_ri],add

Set plot margin of png plot device using par

走远了吗. 提交于 2020-08-07 17:09:01
问题 I've created a choropleth of Brazil. When saving the plot in .png, the upper and the lower part of the plot are lost (covered). Here are the lines to save the plot. plot.new() par(omi=c(0,0,0,0), mgp=c(0,0,0),mar=c(0,0,0,0) , family = "D") par(mfrow=c(1,1),cex=1,cex.lab = 0.75,cex.main=0.2,cex.axis=0.2) png(filename = "map_cons_g.png", width = 6,height = 6, units = "in", res = 600) plot(c(-75,-35),c(0,-30),type="n",axes=FALSE,xlab="",ylab="",asp=1.2) plot(Brazil,col=cols[Brazil$Cons.g_ri],add

Convert 24-bit PNG files to 8-bit color indexed images with pypng

本小妞迷上赌 提交于 2020-07-19 12:05:27
问题 I'm trying to write a python script that takes in standard 24-bit pngs and converts them to 8-bit pngs for better compression. It looks like pypng can do this but I can't quite figure out how to use it. Image manipulation is a new area for me so this may seem silly. I have this currently: r=png.Reader(<myfile>) test = r.asRGBA8() This gives me tuples in return (the layers of the image I believe). However I can't seem to write or save this back to an image. What am I missing? Here's a test

JavaScript array to PNG? - client side

怎甘沉沦 提交于 2020-07-02 18:44:50
问题 Is there any way converting a 2d array of hex codes to a png image? The arrays look like this (only much larger) [ [ '#FF0000', '#00FF00' ], [ '#0000FF', '#000000' ] ] From this array, the image should look like this If the method doesn't work with arrays like this, what type of array will it work with? 回答1: If you want to render a PNG client-side, without libraries, you can use the HTML5 Canvas. Either way, I recommend to stick to a one-dimension array, and store the image’s dimensions. It

Rendering the whole media box of a pdf page into a png file using ghostscript

会有一股神秘感。 提交于 2020-06-27 18:24:30
问题 I'm trying to render Pdfs pages into png files using Ghostscript v9.02. For that purpose I'm using the following command line: gswin32c.exe -sDEVICE=png16m -o outputFile%d.png mypdf.pdf This is working fine when the pdf crop box is the same as the media box, but if the crop box is smaller than the media box, only the media box is displayed and the border of the pdf page is lost. I know usually pdf viewers only display the crop box but I need to be able to see the whole media page in my png

How to replace color of PNG image using CSS? [duplicate]

折月煮酒 提交于 2020-06-23 12:53:57
问题 This question already has answers here : Change color of PNG image via CSS? (16 answers) Closed 2 months ago . I have an icon in a webpage: <div class='icon-container'> <img src = "img/gavel3.png" class="gavel-icon" style='vertical-align:center;width:80px;'> </div> I'm trying to replace the black in this image with the color: #2a4f6c using CSS only. I tried to replace the black with this color using photoshop, and it looks awful and grainy. If there's any solution here using pure CSS, that

How to replace color of PNG image using CSS? [duplicate]

老子叫甜甜 提交于 2020-06-23 12:50:32
问题 This question already has answers here : Change color of PNG image via CSS? (16 answers) Closed 2 months ago . I have an icon in a webpage: <div class='icon-container'> <img src = "img/gavel3.png" class="gavel-icon" style='vertical-align:center;width:80px;'> </div> I'm trying to replace the black in this image with the color: #2a4f6c using CSS only. I tried to replace the black with this color using photoshop, and it looks awful and grainy. If there's any solution here using pure CSS, that

how to reduce the size of png image in pdf (compress png in pdf)

三世轮回 提交于 2020-06-17 13:19:20
问题 I want to reduce the size of pdf file by replacing the high-resolution image with a lower-resolution image. To complete the issue, I have to: extract the images(streams) from pdf compress the images replace the images(streams) in the pdf with compressed images When I extract png images and replace them, the transparent background changes to a black background. I extract the images from the pdf to figure out the reason. There is something very strange that pdf uses to stream to save a png. So

how to reduce the size of png image in pdf (compress png in pdf)

只愿长相守 提交于 2020-06-17 13:19:07
问题 I want to reduce the size of pdf file by replacing the high-resolution image with a lower-resolution image. To complete the issue, I have to: extract the images(streams) from pdf compress the images replace the images(streams) in the pdf with compressed images When I extract png images and replace them, the transparent background changes to a black background. I extract the images from the pdf to figure out the reason. There is something very strange that pdf uses to stream to save a png. So

html2canvas image issue on firefox While working fine on chrome

痞子三分冷 提交于 2020-06-17 11:04:52
问题 I am using html2canvas.js and it's working 100% fine in chrome while in firefox it's not showing some div's which are arrows inside my target div am just converting image to base64 and sending it through ajax to server where I save image and generate pdf. On chrome image and pdf both match 100% with target div while when I try with mozilla it's not not rendering some arrows in image here is my js code html2canvas(div, { canvas: canvas, height: useWidth, width: useHeight, onrendered: function