png

Render PNG file in Rails

大城市里の小女人 提交于 2019-12-12 20:09:34
问题 I have a Rails app where I am trying to display a PNG file but I am getting this error: ActionView::Template::Error (Your template was not saved as valid UTF-8. Please either specify UTF-8 as the encoding for your template in your text editor, or mark the template with its encoding by inserting the following as the first line of the template: # encoding: <name of correct encoding>. The source of your template was: �PNG IHDR#ͱ�) pHYs�]s� IDATx���g@SW�E��7�ZuV묣�Z�:j�mպm�Z��U[W�:�պZ�*�j���@�3� I

Create a PNG having JPG and AlphaChannel in C#

*爱你&永不变心* 提交于 2019-12-12 20:09:31
问题 How can I create a PNG file if I have two separated JPG files with the image and the alpha channel? JPG Image + JPG Mask --> PNG with transparency I've tried WPF solutions: image.OpacityMask = new ImageBrush ( new BitmapImage ( uriMask ) ); and System.Drawing. Image bmpMask = Image.FromFile ( maskFilePath ); gfxNewImage.SetClip ( Graphics.FromImage (bmpMask) ); but I have problems with both (black background, or full black) Any idea or example? ThankYou 回答1: Ok Let's assume that you have a

OpenCV imwrite saving black png

自作多情 提交于 2019-12-12 19:18:40
问题 I'm trying to write a C++ program that applies a flatfield to an image. It's supposed to load an image and divide it by another loaded image, then export it as a PNG. My program compiles correctly, but only produces an all-black image. #include <climits> #include <stdio.h> #include <string> #include <opencv/cv.h> #include <opencv/highgui.h> using namespace cv; using namespace std; int main( int argc, char *argv[] ) { const char *flat_file = argv[1]; const char *img_file = argv[2]; const char

How to capture html output as png in R

删除回忆录丶 提交于 2019-12-12 18:34:28
问题 I use interactive output created by networkD3 package in R. I know how to save the output as html page, but I also need to save the 'static' version of the diagram as .png file. The code looks like this: # Load package library(networkD3) # Create fake data src <- c("A", "A", "A", "A", "B", "B", "C", "C", "D") target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I") networkData <- data.frame(src, target) # Plot simpleNetwork(networkData) I can save the output by clicking on 'Export' and then

How to do in R: load an image file, print text on image, save modified image [duplicate]

故事扮演 提交于 2019-12-12 16:16:56
问题 This question already has answers here : How to plot with a png as background? [duplicate] (2 answers) Closed 5 years ago . ... Ideally, with a PNG image file, if not JPEG. I can load a flie with library(png) img = readPNG("chart.png") but am stuck there. The goal is to type "Hello world" on the image and save it. Thank you. 回答1: I think this should work just fine library(png) #read file img<-readPNG("33.png") #get size h<-dim(img)[1] w<-dim(img)[2] #open new file for output png("out.png",

Display static Google Map image in BlackBerry 5.0

扶醉桌前 提交于 2019-12-12 16:07:28
问题 I'm having a really interesting problem to solve: I'm getting a static google map image, with an URL like this. I've tried several methods to get this information: Fetching the "remote resource" as a ByteArrayOutputStream, storing the Image in the SD of the Simulator, an so on... but every freaking time I get an IlegalArgumentException . I always get a 200 http response, and the correct MIME type ("image/png"), but either way: fetching the image and converting it to a Bitmap, or storing the

Jquery - fadeIn() and fadeOut() in PNG image. Border Solid (black) in IE8…?

倖福魔咒の 提交于 2019-12-12 13:14:29
问题 I am running a fadeIn() and fadeOut() in a block of div where there is a PNG image, with semi-transparent funds (with shadow). See in http://jsfiddle.net/k3KUj/8/embedded/ In IE 8, it appears the hard edges when you run the fadeIn() and fadeOut(), but soon disappears. In Firefox, it's OK. Logical to apply a background color in PNG (for example, with the link above, the background color should be light gray), it works. But do not want to put a background color in PNG. I'm trying to get black

How do I create a template image-based and PDF-based icons for MacOS?

人盡茶涼 提交于 2019-12-12 12:28:30
问题 Summary I'd like to create a template image-based and/or PDF-based icon for a keyboard layout that would switch colors according to dark/light mode in MacOS Mojave when displayed in the menu bar. Background I've created a customized keyboard layout using Ukelele. I've based it on a native keyboard layout, allowing Ukelele to extract the icon from the original layout. I didn't touch the icon. Yet when I switch to dark mode, my layout's icon remains black, whereas in the original layout, it

How to convert .png file to .bmp?

不羁岁月 提交于 2019-12-12 10:08:11
问题 I need to convert a .png file to .bmp; I'm using the outcome in printer_draw_bmp() to print out a barcode. GD can generate WBMP, but as far as I can tell that's not the same as .bmp. How can I do this conversion? Or is there another way to print a .png directly? 回答1: There is a opensource project on Github that allows reading and saving of BMP files (and other file formats) in PHP. The project is called PHP Image Magician. 回答2: AFAIK, GD doesn't support bmp format. But you can use ImageMagick

Convert 32bit PNG file to 24bit PNG file

放肆的年华 提交于 2019-12-12 10:03:27
问题 How to convert 32bit PNG file to 24bit PNG file using PHP. btw I am using Codeigniter, and planning to host files at Dreamhost. Thanks! 回答1: Give this a try: exec('convert -depth 24 /path/to/old/image.png /path/to/new/image.png'); There is a PEAR package for ImageMagick, although making a system call also works if your hosting provider hasn't installed the PEAR package. 来源: https://stackoverflow.com/questions/7658679/convert-32bit-png-file-to-24bit-png-file