image-conversion

Converting between multiple image formats in Objective-C

ぐ巨炮叔叔 提交于 2019-11-28 08:02:41
问题 I want to be able to, being given a path to an image, convert that image into another image, but with a different format. By format I mean .png, .bmp .jpg .tiff, etc. In pseudocode, this is really easy: image = [ImageAPI open: imagePath] [image save: imagePath withFormat: IMAGEFORMAT] // this is important I have no idea how to do this, though. I barely know more than the NSImage class when it comes to handling images), and that does not seem to have the answer to my problem (no simple save

Javascript TIFF Image Conversion

我是研究僧i 提交于 2019-11-28 07:50:31
I am looking for a way to convert a Tiff image into a png so modern browsers can render it. I have looked at Tiffus , but that doesn't look like it is being developed anymore. I have also tried writing a conversion program in C# and sending through JSIL , but that didn't work either. I have also tried using Tiff-js but the sample project isn't working. Does anyone know how to do this? I know I can do it in C#/server-side but we want to try to do it client side. I ported LibTIFF to Javascript with Emscripten ( https://github.com/seikichi/tiff.js , demo: http://seikichi.github.io/tiff.js/basic

Converting .dds to .png: is XNA really this convoluted?

纵然是瞬间 提交于 2019-11-28 06:13:23
问题 I have a .dds file and I want a .png file. Although I already found out about the DevIL.NET library, the API design there of one static class does not parallelize, so I am hoping to find another method. This led me to XNA. But, here's how far I got with that idea... OK, it looks like I want this Texture2D class; then I can call myTexture2D.SaveAsPng . But how do I get one of those from my .dds file? Well the documentation seems to indicate I want to use myContentManager.Load<Texture2D> . Oh

In opencv how do I copy and scale a greyscale image into another colour image

一个人想着一个人 提交于 2019-11-28 05:39:32
问题 I want to composite a number of images into a single window in openCV. I had found i could create a ROI in one image and copy another colour image into this area without any problems. Switching the source image to an image i had carried out some processing on didn't work though. Eventually i found out that i'd converted the src image to greyscale and that when using the copyTo method that it didn't copy anything over. I've answered this question with my basic solution that only caters for

Conversion from CMYK to RGB with Pillow is different from that of Photoshop

徘徊边缘 提交于 2019-11-27 16:29:04
问题 I need to convert an image from CMYK to RGB in python. I used Pillow in this way: img = Image.open('in.jpg') img = img.convert('RGB') img.save('out.jpg') The code works, but if I convert the same image with Photoshop I have a different result as shown below:- The only operation done in photoshop is to change method from CMYK to RGB. Why there is this difference between the two RGB images? It can be a color profile problem? 回答1: SOLVED The problem is that Pillow does not know the input ICC

JPG to PDF Convertor in C#

坚强是说给别人听的谎言 提交于 2019-11-27 08:53:13
I would like to convert from an image (like jpg or png) to PDF. I've checked out ImageMagickNET , but it is far too complex for my needs. What other .NET solutions or code are there for converting an image to a PDF? Ruben Bartelink iTextSharp does it pretty cleanly and is open source. Also, it has a very good accompanying book by the author which I recommend if you end up doing more interesting things like managing forms. For normal usage, there are plenty resources on mailing lists and newsgroups for samples of how to do common things. EDIT: as alluded to in @Chirag's comment , @Darin's

Client-side conversion of rgb-jpg to 8-bit-jpg using Canvas+HTML5

旧巷老猫 提交于 2019-11-27 06:33:15
问题 Many articles shows ways of converting jpeg files to grayscale using canvas+html5 at the client-side. But what I need is to convert an image to 8bit grayscale to reduce its size before uploading to my server. Is it possible to do it using canvas+html5? 回答1: The whatwg specification mentions a toBlob method, which is supposed to convert the canvas to a jpeg or png and give you the binary representation. Unfortunately, it isn't widely supported yet. So all you can do is use getImageData to get

Imagemagick Convert PDF to JPEG: FailedToExecuteCommand `“gswin32c.exe” / PDFDelegateFailed

纵饮孤独 提交于 2019-11-27 01:28:02
问题 I have PDFs that I need to convert to images. I have installed Imagemagick. I have a PDF named a.pdf that I can open (it is not corrupt) in the folder C:\Convert\ From the command line I am trying C:\Convert>convert a.pdf a.jpg And I am getting the error. convert.exe: FailedToExecuteCommand `"gswin32c.exe" -q -dQUIET -dSAFER -dBATCH - dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEV ICE=pamcmyk32" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCIEColor

Convert Transparent PNG to JPG with Non-Black Background Color

穿精又带淫゛_ 提交于 2019-11-27 00:53:57
I'm using System.Drawing.Image in .Net to do a simple conversion from png to jpeg. I'm basically just using these two lines of code: Image img = Image.FromFile(filename); img.Save(newFilename, System.Drawing.Imaging.ImageFormat.Jpeg); it works fine except for when the png files contain transparency due to the alpha channel. In which case the converted jpeg has a black background. Is there any way to make the background white instead? // Assumes myImage is the PNG you are converting using (var b = new Bitmap(myImage.Width, myImage.Height)) { b.SetResolution(myImage.HorizontalResolution, myImage

Convert Transparent PNG to JPG with Non-Black Background Color

你离开我真会死。 提交于 2019-11-26 09:32:14
问题 I\'m using System.Drawing.Image in .Net to do a simple conversion from png to jpeg. I\'m basically just using these two lines of code: Image img = Image.FromFile(filename); img.Save(newFilename, System.Drawing.Imaging.ImageFormat.Jpeg); it works fine except for when the png files contain transparency due to the alpha channel. In which case the converted jpeg has a black background. Is there any way to make the background white instead? 回答1: // Assumes myImage is the PNG you are converting