png

ImageMagick convert SVG to PNG not working with RSVG enabled

爱⌒轻易说出口 提交于 2019-12-18 04:47:07
问题 I'm using ImageMagick's convert utility to convert SVG file to PNG image. At first, I used vanilla installation of IM on OSX ( brew install imagemagick ) to convert the SVG using: $ convert file.svg file.png This worked except that some of the image objects in that file were offset (actual links to images). I then read a related question that suggested ImageMagick to be compiled with rsvg support (homebrew does it with brew install imagemagick --use-rsvg ). Now, when I try to perform the

What is the best way to serialize SVG from the client DOM?

ぐ巨炮叔叔 提交于 2019-12-18 04:19:08
问题 I am working on interactive SVG/AJAX interfaces where elements are created and repositioned on-the-fly by users. I'd like to support the ability for users to export their current view to a PNG image and/or an SVG document. I'd really like the SVG document to be as simple as possible (without a lot of nested transforms). Is there any framework that already supports this? I'm currently asking my users to use the Ctrl+Alt+PrntScrn technique, and I don't want to ask them to install any software

C++ How to get the Image size of a png file (in directory)

元气小坏坏 提交于 2019-12-18 03:43:49
问题 Is there a way of getting the dimensions of a png file in a specific path? I don´t need to load the file, I just need the width and height to load a texture in directx. (And I don´t want to use any third-party-libs) 回答1: The width is a 4-byte integer starting at offset 16 in the file. The height is another 4-byte integer starting at offset 20. They're both in network order, so you need to convert to host order to interpret them correctly. #include <fstream> #include <iostream> #include

Python PIL: how to make area transparent in PNG?

偶尔善良 提交于 2019-12-18 03:33:18
问题 I've been using PIL to crop Images, now I also want to make certain rectangular areas transparent, say from PIL import Image im = Image.open("sample.png") transparent_area = (50,80,100,200) ... I'd really appreciate some code as I haven't been able to find it, thanks a lot in advance! Cheers, Hoff 回答1: import Image import ImageDraw im = Image.open("image.png") transparent_area = (50,80,100,200) mask=Image.new('L', im.size, color=255) draw=ImageDraw.Draw(mask) draw.rectangle(transparent_area,

How do I display a progressive JPEG in an UIImageView while it is being downloaded?

我只是一个虾纸丫 提交于 2019-12-18 01:05:13
问题 Downloading an image from the net and showing it in an UIImageView is fairly easy. However, this requires the image to be completely downloaded before it is shown to the user, completely defeating progressive JPEG (and PNG) images. How can I render the partially downloaded images while the transfer is being done? I would imagine the SDK to have some callback function which would update the image, but I can't find such a function. Is it possible at all with the current iOS SDK? 回答1: Did you

How to encode PNG to buffer using libpng?

一曲冷凌霜 提交于 2019-12-17 22:34:21
问题 I'm currently using the following to write a PNG to a file: #include <png.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> /* Pixels in this bitmap structure are stored as BGR. */ typedef struct _RGBPixel { uint8_t blue; uint8_t green; uint8_t red; } RGBPixel; /* Structure for containing decompressed bitmaps. */ typedef struct _RGBBitmap { RGBPixel *pixels; size_t width; size_t height; size_t bytewidth; uint8_t bytes_per_pixel; } RGBBitmap; /* Returns pixel of bitmap at given

Efficient way to fingerprint an image (jpg, png, etc)?

浪尽此生 提交于 2019-12-17 21:51:40
问题 Is there an efficient way to get a fingerprint of an image for duplicate detection? That is, given an image file, say a jpg or png, I'd like to be able to quickly calculate a value that identifies the image content and is fairly resilient to other aspects of the image (eg. the image metadata) changing. If it deals with resizing that's even better. [Update] Regarding the meta-data in jpg files, does anyone know if it's stored in a specific part of the file? I'm looking for an easy way to

Load image from website

元气小坏坏 提交于 2019-12-17 21:34:26
问题 I am trying to add some chemical structure images to some plots I have created. I am using the ACToR database to access the chemical structures. For example: (http://actor.epa.gov/actor/image?format=png%3Aw250%2Ch250&casrn=80-05-7) The nice thing about this site is you can change the size and the chemical within the url, so I can automate grabbing the images. My hope was to store an object containing CAS numbers, then iterate through the CAS numbers to make the plots. For example: library(png

Writing a PNG in C++

你说的曾经没有我的故事 提交于 2019-12-17 19:56:44
问题 I am trying to write some data to a PNG file using C++ with Visual Studio Express 2013 on Windows 7 64-bit. I understand that to do this, I need to use an external library, but here is where I'm having some difficulty. I tried using LodePNG - it looked simple, lightweight, and easy to use. The problem is, it was TOO simple, and seems to require data in a certain pixel format that doesn't match what I have. I could modify my data to make it compatible with LodePNG, but I'd much rather use a

jQuery fadeIn IE Png Issue when loading from external

笑着哭i 提交于 2019-12-17 19:56:11
问题 I am loading data from external html files within my domain into a div on my webpage using a load content method in jQuery. I take the div out of the new page whilst hiding the div in the current page by fading this out and fading the new one in. There is a png image in both of these divs and it is creating horrid black blobs in IE, works fine in other browsers but due to IEs inability to process multiple filters its making a mess. I tried using the unit png fix to no avail, does anyone have