png

Convert bitmap to PNG or JPG using Objective C

本小妞迷上赌 提交于 2019-12-22 09:51:34
问题 Anyone knows how to convert a bitmap to PNG or JPG using Objective C assuming I have CGImageRef imageRef; 回答1: UIImage *myImage = [UIImage imageWithCGImage:imageRef]; NSData *pngData = UIImagePNGRepresentation(myImage); NSData *jpgData = UIImageJPEGRepresentation(myImage); 来源: https://stackoverflow.com/questions/1740691/convert-bitmap-to-png-or-jpg-using-objective-c

How to convert an .ICO to .PNG with Python?

好久不见. 提交于 2019-12-22 08:19:53
问题 I'm trying to convert a batch of .ICO images over to .PNG images in Python. I have quite a few images to go through so I'd like to find a programmatic solution. I've tried using PIL but I can't seem to get the images and transparency to come out correctly. I'd prefer to use Python but if it can't be done another language or library would also help. 回答1: If it's just a batch job, why not just use imagemagick? 回答2: See http://code.google.com/p/casadebender/wiki/Win32IconImagePlugin It's a PIL

r graphs in jupyter - unable to start png() device

折月煮酒 提交于 2019-12-22 08:10:03
问题 I am using R in Jupyter, but unable to plot graphs in the notebook itself. Here is a reproducible example set.seed(123) mat = as.matrix(x = rnorm(100), y = rnorm(100)) plot(mat) In Jupyter: Error in png(tf, width, height, "in", pointsize, bg, res, antialias = antialias): unable to start png() device Traceback: If I use following, I can save the image in png format in current working directory. png('test.png') plot(mat) dev.off() Edit: SessionInfo() R version 3.4.4 (2018-03-15) Platform: x86

Converting svg to png with inkscape command line failing

烈酒焚心 提交于 2019-12-22 08:04:25
问题 I feel like I must be doing something silly wrong, but I just can't get this to work. This is the command I am running from cmd: inkscape.com "C:\path\ship.svg" -e --export-png="C:\Path\ship.png" --without-gui In return, I get: WARNING: File path "--export-png=C:\path\ship.png" includes directory that doesn't exist. It does exist. What am I missing? 回答1: -e and --export-png are the same argument, according to the docs. -e is just the short version. So you should use either one, but not both.

Changing .png to work with JpegImagesToMovie.java

天大地大妈咪最大 提交于 2019-12-22 06:34:29
问题 I am using the JpegImagesToMovie.java to convert images to a .mov file. I was wondering if there was anyway I could edit this to work with .png files as the quality of the video is not very good and changing it would improve it. ImageIO.write(img, "png", new File("C:\\Users\\user\\Desktop\\tmp\\" + System.currentTimeMillis() + ".png")); ImageIO.write(img, "jpeg", new File("C:\\Users\\user\\Desktop\\tmp\\" + System.currentTimeMillis() + ".png")); ImageIO.write(img, "png", new File("C:\\Users\

Merge png images into single image in WPF

北城以北 提交于 2019-12-22 05:27:14
问题 I'm looking for a way to Merge some PNG tile images into a big image. So I search and found some links. This is not answered properly. This is not tiling, it's good for overlaying images and this is not using WPF. So I'm making this question. Problem Definition: I have 4 PNG images. I want to merge them into a single PNG image, like this ------------------- | | | | png1 | png2 | | | | ------------------- | | | | png3 | png4 | | | | ------------------- Question: What is the best and efficient

Read 16-bit PNG image file using Python

谁都会走 提交于 2019-12-22 05:09:49
问题 I'm trying to read a PNG image file written in 16-bit data type. The data should be converted to a NumPy array. But I have no idea how to read the file in '16-bit'. I tried with PIL and SciPy, but they converted the 16-bit data to 8-bit when they load it. Could anyone please let me know how to up out data from a 16-bit PNG file and convert it to NumPy array without changing the datatype? The following is the script I used. from scipy import misc import numpy as np from PIL import Image #make

Where does this quality loss on Images come from?

旧街凉风 提交于 2019-12-22 04:34:19
问题 in my Winforms application which is connected to a database via Linq to SQL I am saving images (always *.png) to a table which looks like this: CREATE TABLE [dbo].[Images] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Bild] IMAGE NOT NULL, PRIMARY KEY CLUSTERED ([Id] ASC) ); Before I can store a picture I have to convert it to byte[] and this is how I do it: public static byte[] ImageToByteArray(System.Drawing.Image imageIn) { using (MemoryStream ms = new MemoryStream()) { imageIn.Save(ms, System

Does using image sprites make sense in HTTP/2?

我怕爱的太早我们不能终老 提交于 2019-12-22 03:51:14
问题 The bundling of JS and CSS files won't be necessary in HTTP/2, but what about image sprites? Looking at the demo it seems that it already works way faster than HTTP/1.1, but won't bundling images into sprites make it even faster? I mean, won't the PNG's optimization algorithms work better when all the data is in a single file? 回答1: It depends of your image(s) sizes and format. If the images are big enough, you won't gain much by using sprites, but for small images there are significant gains,

How to insert transparent PNG in PDF?

有些话、适合烂在心里 提交于 2019-12-22 03:40:32
问题 I am able to insert JPG image into a PDF document with DCTDecode filter. I think the all parameters should be the same for PNG image too, except the filter which should be FlateDecode . However, when I try to insert PNG with the same parameters, the PNG image is not visible in he PDF document. UPDATE: I came to conclusion that the PDF file should include 1 0 obj << /Type /XObject /Subtype /Image /Width 512 /Height 512 /BitsPerComponent 8 /ColorSpace /DeviceRGB /SMask 9 0 R /Length 134753