FAQ Database Discussion Community


How can I convert PNG to GIF keeping the transparency?

delphi,graphics,png,gif
How can I convert PNG to GIF keeping the transparency? I would have hoped that using the Assign( ) method would work but it doesn't seem to migrate transparency. In the GIF, it's represented as black. png:=TPngImage.Create; try png.LoadFromFile(sFile); // comes from file: png.TransparencyMode; // comes from file: png.Transparent //...

CSS: weird tiling bug in Internet Explorer (any version)

html,css,internet-explorer,png
So, I've got this rather large overlay that I need to tile, and everything works as expected until I get to Internet Explorer. On Internet Explorer when it "tiles" horizontally, I get these odd lines that aren't a part of the original document. The offending HTML and CSS: <html> <head>...

Doing custom avatars with nodejs

node.js,png
So I'm wondering if this http://bokehman.com/do_it_yourself_avatars/ is also possible in nodejs. Basically I want to make a png out of several other pngs (all the same size) that are just stacked one over each other and then save it on the server. Can I do that? A short example would...

C++ Opengl - How to load tgas and pngs in modern OpenGL? [on hold]

image,opengl,c++11,png,tga
I am looking for a way to load tgas and pngs in C++ Opengl - I dislike the idea of using a library though. Is there any sample code / links / advice you could give me in this topic?...

SVG or PNG for html5 android game?

javascript,android,cordova,svg,png
I created html5 android game. It uses simple ball which is device motion moved. For moving ball I use setinterval in javascript and change position for ball element. So what is better to use for better rendering and perfomance? SVG or PNG ball? And other elements in game, like coins,...

Recompile R with PNG support

linux,r,png,raspbian,raspberry-pi2
I am running R 3.1.2 on a headless Raspberry Pi 2 with Raspbian. Packages install fine, but I can't save PNGs. After googling the error for a long time, I found this response, which says I need to "manually recompile R with explicit PNG support." I apologize if this is...

Why is a PNG file often larger without transparency?

web,png,transparency,frontend,photoshop
Often when I am saving a PNG-24 file with transparent areas for web in Photoshop, the file size gets larger when I deselect the transparency option. On the file I was just working on, the file size with transparency was 45.28k, but without transparency it was 53.71k, which is not...

PHP GD How to circular crop 3 square images and merge into 1 image maintaining transparency

php,png,transparency,gd
I have 2 source images and I want to: Do a circular crop of each image, with the outside of the circle transparent Merge/copy all images back onto a destination transparent image. I have tried many examples, but can't seem to maintain transparency on the final image. I'm trying to...

RMagick replacing transparent color

ruby,image,imagemagick,png,rmagick
I have a PNG image (PNG 96x96 96x96+0+0 8-bit RGB 2.05KB 0.000u 0:00.000). It's an icon, with a fully transparent background, and a white symbol (its borders are a gradient from transparent to full white). I want to reduce the whole icon opacity to 30% of its initial value. With...

Png Image instead of Text in PHP [closed]

php,png
Hello i want to show a png image instead of text in my php file for my site. My Code: function format_age($t) { if ($t<30) return "LIVE"; return sprintf("%d%s%d%s%d%s", floor($t/86400), ' Tage ', ($t/3600)%24,' Std. ', ($t/60)%60,' Min.'); } So instead of "LIVE" i want to show an png Image....

How do I grep GZ files to extract PNG files?

grep,png,gz
Ok, so I have a tone of .GZ files in a folder, and I'm looking to recursively look through each one of them and extract all the PNG files into another destination folder. How would I do that? EDIT: I've been using this command from the terminal to find a...

Java IIOException caused by ZipException while trying to convert from String to PNG

java,servlets,png,bufferedimage,javax.imageio
My Java Servlet has a String coming from a client (all I know is that he is actually sending me a PNG as a parameter in a request with contentType = application/x-www-form-urlencoded), and I'm trying to convert it back to a File and save it. Here is my code (based...

Wrong output size when plotting over an image in R

r,image,plot,png,jpeg
My goal is to read an image file in either the PNG or JPEG format and plot various data over said image and save it to disk. I also want the image to take up all available space in the produced plot, no axes or labels or anything. I'm a...

Skip bytes in ByteArray Java

java,png,bytearray,skip
My app reads a png-like file (in byte) and stores bytes into a byteArray. This is the method I use : public static byte[] read(File file) throws IOException { byte []buffer = new byte[(int) file.length()]; InputStream ios = null; try { ios = new FileInputStream(file); if ( ios.read(buffer) == -1...

J2ME - PNG created in PhotoShop not displaying in emulator

java-me,png,emulator,photoshop,wtk
My midlet is showing some images fine, but not others. They are all 8-bit PNGs, but the ones that aren't displaying are the ones I have created myself in PhotoShop. So I am thinking maybe my PhotoShop (CS6) settings are wrong... PNG-8, Selective, Diffusion, Colors: 256, Dither: 100%, Matte: None,...

How to serve PNG to HtmlImageLoadEventArgs callback as byte[]?

c#,png,html-rendering
I am using HTML Renderer to create a PDF. I implemented an image provider to server images (PNG). Its HandleImageLoad is properly called but the provided imgae is not shown in the PDF but something that looks like a clock(?) image. This is the setup: ImageProvider imgProvider = new ImageProvider();...

Uploading PNG to Website Server

php,mysql,image,png
I have seen loads of other topics and I've tried them all. Can someone please help with why this script won't upload PNG files? Blank PNG image being displayed. $image = $_FILES['file']['tmp_name']; $image_name = $_FILES['file']['name']; $ext = pathinfo($image_name, PATHINFO_EXTENSION); $location = "Profiles/{$user}/Picture/{$image_name}"; $new_image = imagecreatetruecolor(100, 100); $source_image = imagecreatefrompng($image); imagealphablending($source_image,...

Error with PNG files extracted from iPhone app?

iphone,png,pngcrush
I extracted a photo folder from an iPhone app but all the PNG files in the folder are not viewable. I tried googling it up and then tried few apps that fix PNGs from iPhone, but none of them worked. One app even said that my files were NOT in...

Is there a way to measure the memory consumption of a PNG image?

python,memory,png
I would like to know if there is a way in Python to measure the memory consumption of a PNG image. For my test I've to Images normal.png and evil.png. Let's say both images are 100kb in size. normal.png consists of data represented by 1 byte per pixel. evil.png consists...

Analysing a png (1bit color) for pixel

python,image-processing,png
Today I want to know how I analyse a png image with 1 bit color depth (100*30) pixel. The pixels in the image are numbered 0..99 for the first row, 100..199 for the second row etc. White pixels represent ascii codes. The ascii code for a particular white pixel is...

How I can get the Base64 data after converting div to img?

javascript,jquery,html,canvas,png
I am not expert in javascript I wanted to convert div to image then I found this jsfiddle $(function() { $("#btnSave").click(function() { html2canvas($("#widget"), { onrendered: function(canvas) { theCanvas = canvas; document.body.appendChild(canvas); // Convert and download as image Canvas2Image.saveAsPNG(canvas); $("#img-out").append(canvas); // Clean up //document.body.removeChild(canvas); } }); }); }); but how I...

Decode image to bitmap ok, but why?

image,bitmap,png,decode
I would like to know why we need to decode let's say a png to a bitmap in order to show the image. Why not just show the png like that (encoded). I'm asking here a moron type of question on purpose. It's clear to me it's impossible to show...

Highcharts: overlapped columns in exported chart

javascript,highcharts,export,png
The live chart looks fine, however, when exported to PNG, JPEG or PDF, the columns overlap. The code: http://jsfiddle.net/strawberry/1s27pjed/ exporting:{ chartOptions:{ legend:{ enabled:true, style: {fontFamily: "Arial"} }, } }, In addition, is there an option to change the font and size of the legend text in the export? I was...

Exporting png/svg as a single png file using PHP

javascript,php,svg,export,png
So basically I have use SVG/javascript/PHP so that when a user clicks on a PNG image it takes the coordinates and uses these to plot a small black square on the PNG image, it's really very simple. However, I was wondering if it's possible if you have the PNG in...

How can I create a clip to show the evolution of a network?

r,network-programming,png,igraph
Through R I can generate the topology of a network at each t, where t = 2000. What is generated is a .png file for each t. Do you know a program (or a way) to use these .png files as "frames" to create a video of how the network...

Replace ImageView from PNG to GIF

android,replace,imageview,png,gif
I want to replace ImageView from PNG to GIF. I tried with this code: ImageView kotek = (ImageView)findViewById(R.id.imageView4); nYAn.setImageResource(R.drawable.kot); But GIF isn't animate. What i should do? Sorry for my bad English :P...

Consistent PNG Bit output with PHP Imagick

php,png,fpdf,imagick
I have the following code to create a png swatch with a drop shadow (to dynamically insert in a PDF file using FPDF.) $shadowSwatch = $pm->clone() ; $shadowSwatch->setImageBackgroundColor('#000000') ; //Angle & Offset of Drop Shadow based on photoshop settings $angle = deg2rad(45) ; $xOffset = round(sin($angle) * 18, 0) ;...

C++ Bitmap Resource (RT_BITMAP) and PNG Image Format

c++,bitmap,png
An application I'm developing displays various PNG images to the user in a window, and it works fine. My question is more on the grounds on HOW my PNG's are stored in the PE. Currently, the PNG's are stored in the executable as a resource, under the RT_RCDATA Resource Type,...

Why does Delphi XE7 change PNG image on every FMX form save?

delphi,png,firemonkey,delphi-xe7
I have a form with many custom firemonkey components where each contain multiple bitmaps (loaded from PNG image files). Every time the form is saved, the binary data of the PNG images change in the FMX file! This messes up my version control log (SVN), as changing just one property...

Why does PNGing an image from a JPG make it 10x bigger?

png,jpeg,bmp
I have an image captured via webcam of my cat (the subject might not be important). I've aquired it as a 31 kB JPG file. When I open it with an image editor, then save it (without alteration) as a PNG (max. compression) it stores as a 297 kB file....

Can't get entire png from PhantomJs render command

javascript,html,image,png,phantomjs
I am using PhantomJS for converting html file into png. Actually, my html file is bit lengthier in horizontal way.PhantomJs do not capture its image entire up to last horizontal scroll.I'm using render command for converting html into png.What exactly I am missing or is there any limitation phantomJS has...

python seqdiag file is big and can't be openned in other computer?

python,png,appdata
I have used seqdiag to generate sequence diagram, and it generates 3MB png file. It sounds great, right? But something wrong when I open it. When I open the file, appdata/local/temp has gained 3GB, and generates big files named ~PI*.tmp. After I send the png file to others, they can't...

GDlib PHP - png to gif returns background transparent to black

php,png,gd,gif
When trying to convert PNG to GIF, return transparent to black: $file = "example.png" $whf = getimagesize($file); $wf = $whf[0]; $hf = $whf[1]; $h = "100"; $w = "100"; $img = imagecreatetruecolor($w, $h); $imgi = imagecreatefrompng($file); // Here means to be some magic code... imagecopyresampled($img, $imgi, 0, 0, 0, 0,...

Xcode built-in png compression effects

ios,xcode,sprite-kit,compression,png
I have a question about png-8 vs png-24 usage vs Xcode's built in "image compressor". Some images converted to png-8 are just fine saved like that, because difference between png-24 version can't be noticed easily. But some images have to be stored as png-24 so that quality remains at high...

How to Save UIImage to a Transparent PNG?

ios,objective-c,uiimage,png,transparent
I'm not sure where I'm doing the mistake, that's why I'd like to paste here some block of codes in order to find out what went wrong. I have some PNG images that have transparent background and with using the block of codes below I'm trying save the selected image...

Imagemagick convert tif to rgba16 png

imagemagick,png,tiff,imagemagick-convert
So here is my source tif image: $ identify -verbose source.tif Image: Format: TIFF (Tagged Image File Format) Class: DirectClass Geometry: 512x512+0+0 Resolution: 72x72 Print size: 7.11111x7.11111 Units: PixelsPerInch Type: Palette Base type: TrueColor Endianess: MSB Colorspace: RGB Depth: 8-bit Channel depth: red: 8-bit green: 8-bit blue: 1-bit And I've...

Game Multi-Images Android

android,png,assets
I have seen a lot of developer use all asset or images or drawable needed into one file png like this : the question is how can developer split each image to use it in android ? and what's advantage of this technique ? ...

How to stop browser making images fainter

php,google-chrome,firefox,png,imagick
I've noticed the following behaviour in Chrome and Firefox on Ubuntu Linux and Windows 8: A greyscale image containing text is perfectly legible when viewed in a picture editor, but browsers somehow make the greys much paler than the image is when viewed in them (Chrome, Firefox) Does anybody have...

Trouble downloading PNG images in Android

android,png,imagedownload
I am facing a problem downloading PNG images from my server to my Android app. The problem is specific to PNG images (JPG works fine), and the issue is that the downloaded files are corrupt images. I will explain in more details, below. Scenario : I need to download JPG...

PNGImage “Access violation” error at procedure end

delphi,png,delphi-7
I am using PNGImage library in my project, which entire GUI is made up of .png images, which i loaded to TImages at run-time. For some purposes i have to dynamically create plenty of components groups that are similar to each other. Every group consists of some TImages and have...

How can I transform a PNG to a BMP without loosing quality

.net,image,png,bmp
This is a tricky one. First tried this with an awful result Image Dummy = Image.FromFile("image.png"); Dummy.Save("image.bmp", ImageFormat.Bmp); -----transforms into----> I have no idea what could be happening. Any clues?...

How to encode IImageProvider as a PNG image?

windows-phone-8.1,png,windows-8.1,win-universal-app,lumia-imaging-sdk
Assuming I have a LumiaImagingSDK rendering chain setup, with a final IImageProvider object that I want to render, how do I encode that into a PNG image?

Use image Button with transparent color area

c#,button,png
I have a picture in PNG with transparent and normal color. I use this for one Button: this.Button1.BackColor = System.Drawing.Color.Transparent; this.Button1.BackgroundImage = Image; this.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.Button1.FlatAppearance.BorderSize = 0; this.Button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; this.Button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;...

Compare images and remove duplicates

image,compare,imagemagick,png
I have two folders with images, they're all PNGs. One folder is a copy of the other with some images changed and some added. The filenames are the same but the image contents may be different. Other attributes like time stamps are completely random, unfortunately. I want in the newer...

Sending png file via socket in Python

python,sockets,png,send
I'm using python version 2.7.9 and i try to send png file. But something strange happens..i using sockets and sends a post request(or kind of). I send the request to the server from the client,then i prints the length of the request received on the server, for example, the length...

How to Convert PSD into PNG, using Python Wand / ImageMagick?

python,imagemagick,png,psd,wand
I tried converting PSD to PNG, but as I save the PNG, Wand (wand-0.4.0-py2.7) spits out all layers inside the PSD as separate PNG files (the last file saved is the one I want). So how to correctly convert from PSD to PNG? # Convert a large PSD to small...

Can a easeljs hitarea be set using image data?

javascript,png,easeljs
I'd like to be able to set set the hit area of my Display objects using image data instead of a Shape object. However setting the hitarea property of my objects doesn't seem to be working. Here's an example of what I'm attempting. Say we have this sprite sheet for...

What renders faster, pre-defined image alpha, or opacity?

css,performance,web,png,transparency
If I have a png image that is 127 alpha, and I have the same image with normal alpha (255) and a CSS style of opacity:0.5, which will render faster? The reason I'm asking is I want a few partially transparent clouds in a webgame, and I'm interested to know...

Rename a bunch of PNG images with “.jpg” extension to “.png”

image,bash,scripting,png,jpeg
So I have a folder with thousands of image files, all of them saved as .jpg. The problem is that some of those files are actually PNG image files, so they don't open in a lot of programs, unless I manually change their extension to .png. For example, the Ubuntu...

JavaScript array to PNG? - client side

javascript,arrays,png
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...

Generate overlay map image from geo data

google-maps,png,overlay,cluster-computing
I need to generate a transparent image to apply on map similar to these: Image_1or Image_2 I need to generate this image from a dataset: I have many data points (with lat and long) and I would to generate this image (server side) to show density on map of my...

Large repeating background image in Internet Explorer

html,css,internet-explorer,png
I'm trying to have an oversized image within a viewport container presented as a background image with a repeat style on it. The below code works for Chrome and Firefox, but when looking at it in Internet Explorer (observed in 9 and 11 on multiple machines), I'm getting an odd...

Resize PNG image without losing color data from fully transparent pixels

c#,png,gdi+,alpha
I've been trying to figure out a way to resize a PNG image without losing color data from pixels that are completely transparent. Here is the code that I'm using to achieve this: //sourceImage is also a bitmap read in earlier using (var scaledBitmap = new Bitmap(desiredWidth, desiredHeight, PixelFormat.Format32bppArgb)){ using...

PHP: PNG readfile encoding issue

php,encoding,png,php-gd
I have this code which outputs a PNG file to the browser header('Content-type: image/png'); header("Content-Length: " . filesize($cache_file)); readfile($cache_file); exit(); The file $cache_file was saved like this imagepng(self::$image, self::$cache); The browser is displaying a broken image. When I download it and open it with npp, I find that it's encoded...

Letter 'j' bugged with imagettftext function

php,png,gd,true-type-fonts,imagettftext
I've created a script to generate an avatar by using PHP and all work fine but when there is the letter j in $data1['username'], the letter erase a part of the previous letter. NOTE : I use calibri bold italic (Downloaded here) This is my code : $image = imagecreatefrompng("avatar.png");...

Improve PNG optimization Gulp task

optimization,compression,png,gulp,gulp-imagemin
This is source PNG with transparency: http://i.imgur.com/7m0zIBp.png (13.3kB) optimized using compresspng.com: http://i.imgur.com/DHUiLuO.png (5.4kB) optimized using tinypng.com: http://i.imgur.com/rEE2hzg.png (5.6kB) optimized with gulp-imagemin+imagemin-pngquant: http://i.imgur.com/OTqI6lK.png (6.6kB) As you can see online tools are better than Gulp. Is there a way to improve PNG optimization with Gulp? Just in case, here's my gulp task:...

rename multiple res/drawable png files in eclipse

android,png,android-drawable
In my res/drawawble directory in eclipse I have named my png files py (1), py (2)... py (120)! I am unable to run my application on my emulator because the r.java file has killed itself due to my improper naming of my png files. Is there a way for me...

How do graphic file format types work?

graphics,png,file-format
I'm very interested in understanding how graphic file format (PNG, JPG, GIF) work. Are there any code examples that demonstrate how these files are made and also how they are interpreted (viewed in browser)?

Why the first byte of .png file is 0x89?

file,png,formats
I am currently reading about PNG file format. It turns out that the first byte of the file is specified to be equal to 0x89. I am wondering what are the reasons of the value of that byte. What I've already learned about the format is that the first byte...

PNG transparent backgrounds appearing black when using Android Studio

android,android-studio,png,adt,android-drawable
The social icons below (for fb, twitter, mail and share) are circular PNGs with transparent backgrounds. When I use the code and exact same images in Eclipse, I get transparent background but when build and run with Android Studio, I get black backgrounds. See details below. Images are the same....

worklight server preview wont show png resources anymore after configuring it to serve svg

svg,png,worklight
I ran in the problem where svg images were not loading using WorkLight preview. I found the solution for that here: How can I configure Worklight to serve *.svg files with contentType=image/xml+svg? After adding these lines <mimeTypes> <type>svg=image/svg+xml</type> </mimeTypes> svg files appeared on preview, but now i can't load png...

What do these bytes do?

format,png,file-format
This is the hexdump of a black 1x1 PNG made in Gimp and exported with minimal information: 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 00 01 00 00 00 01 08 02 00 00 00 90 77 53 DE...

Native PNG library on MacOSX (mavericks)

c,png,jpeg,osx-mavericks,tiff
I need to build an application which can read PNG files. On MacOSX mavericks the libpng is not available anymore (see). Is there any other way to read PNG file on MacOSX (Cocoa / Carbon Framework...). I'd rather stay with the native framework than download and compile a local libpng....

Transparent gif not transparent?

html,css,png,transparent
I downloaded a transparent png from findicons.com, and I thought that if I placed this png on my html page, that has a gradient colored background, I would only see the icon (a down arrow in this case). Instead, however, I see the icon and a white(ish) box surrounding the...

Converting 32x32 StdPicture icons to PNG

arrays,vb6,png
I am trying to convert an StdPicture into a PNG before encoding it to Base64 to be sent over XML. I've gotten the Base64 encoding portion down (see near end of function EncodeImageToBase64()) however I am having trouble converting the StdPicture object into a PNG byte array. Here's my function:...