jpeg

Java ARGB to JPG

一曲冷凌霜 提交于 2020-01-10 04:16:10
问题 How can I save BufferedImage with TYPE_INT_ARGB to jpg? Program generates me that image: And it's OK, but when I save it in that way: ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); BufferedOutputStream bos = new BufferedOutputStream(byteStream); try { ImageIO.write(buffImg, "jpg", bos); // argb byteStream.flush(); byte[] newImage = byteStream.toByteArray(); OutputStream out = new BufferedOutputStream(new FileOutputStream("D:\\test.jpg")); out.write(newImage); out.close(); }

How to use PIL to resize and apply rotation EXIF information to the file?

折月煮酒 提交于 2020-01-09 08:43:01
问题 I am trying to use Python to resize picture. With my camera, files are all written is landscape way. The exif information handle a tag to ask the image viewer to rotate in a way or another. Since most of the browser doesn't understand this information, I want to rotate the image using this EXIF information and keeping every other EXIF information. Do you know how I can do that using Python ? Reading the EXIF.py source code, I found something like that : 0x0112: ('Orientation', {1: 'Horizontal

How to use PIL to resize and apply rotation EXIF information to the file?

空扰寡人 提交于 2020-01-09 08:42:29
问题 I am trying to use Python to resize picture. With my camera, files are all written is landscape way. The exif information handle a tag to ask the image viewer to rotate in a way or another. Since most of the browser doesn't understand this information, I want to rotate the image using this EXIF information and keeping every other EXIF information. Do you know how I can do that using Python ? Reading the EXIF.py source code, I found something like that : 0x0112: ('Orientation', {1: 'Horizontal

Batch file to copy files from folders&sub folders using a file list only if file size greater than

此生再无相见时 提交于 2020-01-07 03:59:12
问题 We have images of our warehouse stock within our database. We will pull a list of the file names for those images into a .txt file. The content of the file-list.txt will be for example: 060128412948.jpg 068912475982.jpg etc. We have 3 images for each stock 2 of them are low resolution and 1 of it is a high resolution image. I need the script to only copy the high resolution image for each stock from the folders/sub-folders into a mother directory. This is what I have so far but this only

how to decode JPEG's and encode video in python?

ぐ巨炮叔叔 提交于 2020-01-06 18:05:31
问题 Basically, I'm trying to create a stop-motion film making application, due to the absence of any decent free versions that work on the internet, by taking images (JPEG preferably, but any format will do) and encode them into a video (any format is good enough) I've managed so far to decode a JPEG data into a string and save that to a .txt file, and I've re-encoded another JPEG using the bytes decrypted. I've tried PyMedia and Pyglet, neither of which installed due to having Python 3.3 >:( So,

Why is the maximum ffmpeg mjpeg quality so low?

三世轮回 提交于 2020-01-06 06:47:04
问题 I used ffmpeg to generate a one-frame mjpeg video at the maximum possible quality, like this: ffmpeg -i reference.png -frames:v 1 -codec:v mjpeg -q:v 1 -an 1.mkv I also made a reference conversion to jpeg using imagemagick, at 85% quality: convert reference.png -quality 85 85.jpg The resulting "1.mkv" is only 83K, despite the fact that 85.jpg is 88K - and that's not even the highest possible jpeg quality. At 95% imagemagick produces a file of 120K, and 207K at 100%. (Though it should be noted

Flash Loader and ByteArray

与世无争的帅哥 提交于 2020-01-06 03:53:07
问题 I need to be able to load a jpeg/png image from disk and show it in flex and send it to a server as a base64 encoded string. But once the image file is loaded, in my flash.display.LoaderInfo object, the bytes property (type of ByteArray ) contains more byte than the file content. Example: image file size: 3089 flash.display.LoaderInfo.bytesTotal:3089 flash.display.LoaderInfo.bytes.length:3155 As i need to encode the flash.display.LoaderInfo.bytes in base64 string, i don't know which part of

Image uploader, capital letters in JPG extension doesn't work

给你一囗甜甜゛ 提交于 2020-01-05 08:01:31
问题 I'm making an image uploader but for some reason i'm not allowed to upload JPG images in capital letters. How is this possible? I also tried to add JPG to the allowedExts array but that is also not working. $filesize = '8500'; // PUT the filesize here in KB if(isset($_FILES["file"])){ $allowedExts = array("jpg", "jpeg", "gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); var_dump($_FILES['file']['type']); var_dump($extension); if ((($_FILES["file"]["type"] == "image/gif")

Decryption of .png and .jpg files

二次信任 提交于 2020-01-05 07:31:17
问题 I'm trying to modify graphic assets of the software I'm using (for aesthetic puroposess, I guess it's hard to do something harmful with graphic assets) but developer encrypted them. I'm not sure why he decided to do that since I used and modified a bunch of similar softwares and developers of those didn't bother (as I can see no reason why encrypting those assets would be necessary). So anyway here are examples of those encrypted graphic assets: http://www.mediafire.com/view/sx2yc0w5wkr9m2h

Android GIMP JPG to PPM conversion

放肆的年华 提交于 2020-01-05 02:33:20
问题 How exactly does GIMP convert a jpg into a ppm? I'm trying to convert a jpg to a ppm on Android. In Android I use the API to create an ARGB_8888 Bitmap of the jpg then drop the Alpha channel and throw the RGB values into a ppm. But I get different values for RGB from GIMP. 回答1: Have a look into the code. You can find it here: http://git.gnome.org/browse/gimp/tree/plug-ins/common/file-pnm.c 来源: https://stackoverflow.com/questions/4908635/android-gimp-jpg-to-ppm-conversion