image-conversion

How do I convert a TIF to PNG in Java?

北慕城南 提交于 2019-12-17 16:13:40
问题 Under Java what is the best way to go about converting an TIF file to a PNG? Simplicity is preferable, but if the simplest way is to use a third party library then I would consider that solution. 回答1: First, install JAI. Then install JAI/ImageIO. Then do public static void main(final String[] args) throws Exception { final BufferedImage tif = ImageIO.read(new File("test.tif")); ImageIO.write(tif, "png", new File("test.png")); } 回答2: Use imageMagic java libraries like im4java, their

JPG to PDF Convertor in C#

北城余情 提交于 2019-12-17 09:46:38
问题 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? 回答1: 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

I need to create a bitmap in c code in NDK

与世无争的帅哥 提交于 2019-12-13 05:13:33
问题 So my issue is that I get for a video call the frames in my c code as a byte array of I420. Which I then convert to NV21 and send the byte array to create the bitmap. But because I need to create a YUV Image from the byte array, and then a bitmap from that, I have a conversion overhead and that is causing delays and loss in quality. I am wondering if there is another way to do this. Somehow so that I can create the bitmap directly in the c code, and maybe even add it to the bitmap, or a

How to convert the ordinary jpeg image bytes to the DICOM native image bytes using C#

荒凉一梦 提交于 2019-12-13 02:04:54
问题 Currently I'm writing a module for the conversion of JPEG to DICOM Image Conversion. On analysis I've completed the tag rendering, now the image is not properly rendered in the DICOM file. Is there any algorithm to convert the JPEG to DICOM . 回答1: Continuing from Matthieu's response, here is a very simple way of creating a DICOM envelope for a JPEG stream using the excellent GDCM library and his referenced example (note I have used some helper classes, but is quite simple): ImageReader r =

Google Maps Static Map API path from KML

让人想犯罪 __ 提交于 2019-12-12 01:16:05
问题 I am working on to convert map into Image. After studying, I have found that we can request for markers as well as path for converting image from the map. In my case I need to convert all markers and KML file loaded on the map. http://maps.google.com/maps/api/staticmap?center=38.267028,-82.83526899999998,&size=640x640&zoom=6&maptype=terrain&markers=icon:http://www.energymapit.com/Images/greensmallnew.PNG|37.52,-82.82|38.27,-82.84 This is what I have done so far for markers. And following

Create image of, “specific page” of postscript file using ghostscript

泪湿孤枕 提交于 2019-12-11 12:42:41
问题 Please someone help me with ghostscript.... I want to create image of a particular page postscript file using ghostscript. I will specify the page number or something like that will get the respective image as output. Is this possible with ghostscript? 回答1: In current versions of Ghostscript you have two choices: 1) Render every page to an image file, use the '%d' file name format so that you know which page you want, delete the others. 2) PostScript is a programming language. Write a

Opera Turbo and background-repeat doesn't work

痴心易碎 提交于 2019-12-11 07:06:28
问题 For example I have such a code: <style> body { background: url('back.png') repeat-y center; } </style> <body> </body> It works fine in all browsers, include Opera. Looks like this: But if Opera Turbo mode is turned on, than it looks like this: Why is this, and can it be fixed? P.S. Opera 11.10 on Ubuntu 10.10 回答1: To find why your images sometimes look like a mess in Opera Turbo, you should learn how Opera Turbo works (actually, what is Turbo mode). As you know, Opera Turbo comes very handy

Combining GIF images and colormaps to 3-D image arrays

大憨熊 提交于 2019-12-11 04:20:16
问题 When I read a color JPEG image: jpgim = imread('path/to/image.jpg') I get an MxNx3 array. However, with GIF files I also need to read the colormap: [gifim, map] = imread('path/to/image2.gif') Let's assume that I need only the first frame if the GIF image is animated: gifim = gifim(:,:,:,1) Is there a way to get a standard MxNx3 image array using gifim and map as that is what later parts of my processing pipeline expect? 回答1: Use ind2rgb: im = ind2rgb(gifim, map); 来源: https://stackoverflow.com

How to Generate a Data URI

馋奶兔 提交于 2019-12-10 21:33:55
问题 I recently came across Data URI scheme and was reading about it on Wikipedia. Example code looks something like this: <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot"> My question is this: How do you generate the code (IE: iVBORw0KGgoAAAA... ) for using on a website? Note: I am specifically looking for how this is done with no server side scripts. But you can still post server

How to convert PNG to BMP at runtime?

 ̄綄美尐妖づ 提交于 2019-12-10 10:17:57
问题 I need to convert PNG file to BMP file on runtime. I can't do it like Image dummy = Image.FromFile("image.png"); dummy.Save("image.bmp", ImageFormat.Bmp); because i can't save the bmp image on the local disk as a file. Thanks for any help. 回答1: You can save to stream using(MemoryStream stream = new MemoryStream()) { Dummy.Save(stream, ImageFormat.Bmp); } 回答2: Precise answer given here. Image Dummy = Image.FromFile("image.png"); Dummy.Save("image.bmp", ImageFormat.Bmp); Since you don't want to