png

How do I make a png with transparency appear transparent in MatLab?

依然范特西╮ 提交于 2019-12-20 02:47:08
问题 I have an image with a transparent background, but when I open it in MATLAB, I get a black background. I'm overlaying it on top of a background image. How can I get this to display? I've tried using the alpha function alpha(image,0) but it sets my entire image to 0. Is it possible for me to set the alpha of individual pixels to be equal to 0? That way I can run each pixel through a loop. I'm not sure if this helps, but when I run a imfinfo('ryu1.png') , I get : ... Transparency = 'alpha'

BitmapFactory.decodeStream cannot decode png type from ftp

浪子不回头ぞ 提交于 2019-12-20 01:59:14
问题 What was my mistake? How I show png from FTP? I'm newby for android and try to show image from difference connection/source. Then I already show image which load from drawable and HTTP. Now, I'm try to show from FTP, I get message "--- decoder->decode returned false" when I use.. BitmapFactory.decodeStream(ins, null, options); Then I found solution.. static class FlushedInputStream extends FilterInputStream { public FlushedInputStream(InputStream inputStream) { super(inputStream); } @Override

Qt does not load JPG , just PNG

人盡茶涼 提交于 2019-12-19 21:27:08
问题 I work with my colleagues on the same project on Windows 7 64 bit version, Visual Studio 2008. They load JPG and they work. Through QPixmap and Stylesheets. And works. But for me, i can only work with PNG, the rest don´t work at all. I also tried to change paths on the environment variables, but i only see one Qt path (the bin) on it. Nothing about plugins, i guess... as i read on the documentation: "By default, Qt can read the following formats: Format Description BMP Windows Bitmap GIF

关于canvas.toDataURL的那些坑

旧巷老猫 提交于 2019-12-19 17:26:37
关于canvas.toDataURL的那些坑 HTMLCanvasElement.toDataURL() 方法返回一个包含图片展示的 data URI 。可以使用 type 参数其类型,默认为 PNG 格式。图片的分辨率为96dpi。 如果画布的高度或宽度是0,那么会返回字符串“data:,”。 如果传入的类型非“image/png”,但是返回的值以“data:image/png”开头,那么该传入的类型是不支持的。 Chrome支持“image/webp”类型 此代码是用了jspdf生成当前页面的pdf 发现pageData 由canvas.toDataURL('image/jpeg', 1.0); 获取的变量没有内容,查了好久网上也没发现问题,后来突然想到是有张图片404 导致的 有这种问题的同学 注意下404 页面有错误 canvas.toDataURL 绘制就会有问题 HTMLCanvasElement.toDataURL() 方法返回一个包含图片展示的 data URI 。可以使用 type 参数其类型,默认为 PNG 格式。图片的分辨率为96dpi。 如果画布的高度或宽度是0,那么会返回字符串“data:,”。 如果传入的类型非“image/png”,但是返回的值以“data:image/png”开头,那么该传入的类型是不支持的。 Chrome支持“image/webp

Bitmap color change while compressing to png

僤鯓⒐⒋嵵緔 提交于 2019-12-19 10:26:06
问题 I'm currently working on a steganogrpahy android app as a class project. I've created an object that will encode an image with in another image and return an encoded bitmap. This code is run in a seprate thread. new Thread(new Runnable() { public void run() { Bitmap encoded_image = null; Encryptor encryptor = new Encryptor(); encoded_image = encryptor.encode_image_in_image( image_location,message_image_location); } }).start(); After encoding the bitmap I was passing the bitmap to a file

IE6 png 透明--四种解决方法

自古美人都是妖i 提交于 2019-12-19 09:56:32
FF和IE7已经直接支持透明的png图了,下面这个主要是解决IE6下透明PNG图片有灰底的 方法一:定义一个样式,给某个div应用这个样式后,div的透明png 背景图 片自动透明了。(注意两处图片的路径写法不一样,本例中, icon_home.png图片与html文件在相同目录) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> <!-- .qq { height: 90px; width: 90px; background-image: url(icon_home.png)!important;/* FF IE7 */ background-repeat: no-repeat; _filter: progid:DXImageTransform

PHP/GD ImageSaveAlpha and ImageAlphaBlending

让人想犯罪 __ 提交于 2019-12-19 09:06:32
问题 I'm using GD to resize and convert images, however during my tests I found a weird behavior when converting transparent PNG's to JPEG's. According to the manual ImageAlphaBlending() is on by default but in order to preserve the transparency I must set ImageSaveAlpha() to true (which in turn requires that I set ImageAlphaBlending() to false). So the correct way should be: $result = ImageCreateFromPNG(...); ImageAlphaBlending($result, false); ImageSaveAlpha($result, true); ImageFill($result, 0,

Single channel png displayed with colors

喜欢而已 提交于 2019-12-19 08:54:04
问题 I'm checking out the ground truth segmentation masks of the pascal voc 2012 dataset. These are single channel 8-bit uint png files. However when I open these images in either the file browser (nautilus) or the image viewer (eog) they are displayed in colors. Shouldn't it be displayed in grayscale? When I store an image as single channel 8-bit uint png file using Matlab, it is displayed in grayscale as expected. What is the difference are there different types of png files? How can I store it

Converting a TIFF image to PNG/JPG/GIF in PHP without Imagick

一世执手 提交于 2019-12-19 07:51:03
问题 I am working on a website for my client in which tiff images need to converted to png or jpg before they are assembled into a PDF. I have read many articles, here and other sites, on this issue. They all recommend using Imagick to accomplish this. The problem is, my client's server does not have that extension installed, and the hosting company is unwilling to install the extension. Nor is PDFLib installed on the server (which supports importing tiffs into a PDF). Thanks. 回答1: This is tricky

ImageMagick PNG Resize Increases File Size

淺唱寂寞╮ 提交于 2019-12-19 06:15:21
问题 I am resizing images using ImageMagick. If I pass a -resize WxH option it behaves as expected. But if I pass -resize WxH! (to ignore aspect ratio during resize), some images, especially PNGs, are actually increasing in size. A 200k image becomes 450k, a 170k image becomes 360k and so on. Any ideas why this is hapenning and how to fix it? Thanks 回答1: After researching, I upgraded my ImageMagick version from 6.3.7 to 6.5.6, and now it is working great. Resizing images is generating smaller