FAQ Database Discussion Community


What's wrong with my graphics?

java,user-interface,jpanel,jpeg,paintcomponent
On the first guess, the graphic that's supposed to show up doesn't show. And on the eighth guess, no graphics show up at all. (The user is allowed 10 tries before they lose). Any ideas on why this is happening? Help is appreciated! HangmanFigure.java import java.awt.*; import javax.swing.*; public class...

Converting images to PDF with iTextSharp preserve clipping path

c#,itextsharp,itext,jpeg,clipping
We're looking to convert images in bulk to PDF, programmatically. So far it looks like we will be using iTextSharp but we have an issue with JPG images with clipping path. We are using the following code in our tests: using (FileStream fs = new FileStream(output, FileMode.Create, FileAccess.Write, FileShare.None)) {...

where is the DCT matrix in Libjpeg?

image-processing,jpeg,libjpeg,dct
In libjpeg I am unable to locate the 8x8 DCT matrix ? If I am not wrong this matrix is always a constant for a 8x8 block . it must contain 1/sqrt(8) on the first row but where is this matrix ?

Image appearing on local but not online

html,ftp,jpeg
I have a little problem that seems pretty strange to me. I've got an image on my website (actually it's my CV). This image is showing herself perfectly in local (MAMP) but once online she is not appearing at all. I don't think it could came from a problem of...

Rename a bunch of PNG images with “.jpg” extension to “.png”

image,bash,scripting,png,jpeg
So I have a folder with thousands of image files, all of them saved as .jpg. The problem is that some of those files are actually PNG image files, so they don't open in a lot of programs, unless I manually change their extension to .png. For example, the Ubuntu...

Magick++ to display an image with CGI

c++,imagemagick,cgi,jpeg,magick++
I recently began using Magick++ (C++ API for ImageMagick) with the goal of creating a website that could display randomly generated images. I am trying to write a CGI script which would create a JPEG Image, set the color of its pixels, and then return the image information as Content-type:...

How to create progressive jpg on parse

parse.com,jpeg,cloud-code
I have a fairly large class on parse, with about 10,000(each of about 5mb, then generated smaller ones of about 300kb and 30kb) images and growing rapidly. I need to generate progressive jpegs for each image. Is there a way i could do this on parse cloud code? As in:...

Convert jpg image in ppm P3 ASCII format using Opencv

c++,opencv,jpeg,ppm
Using opencv imwrite function I managed to convert jpg image in ppm P6 format. Mat image = imread(picPath); vector<int> compression_params; compression_params.push_back(CV_IMWRITE_PXM_BINARY); compression_params.push_back(1); imwrite("bez.ppm", image, compression_params); Problem is that I actually have to convert jpg image in ppm P3 ASCII format. Does anyone know how to do it? Thanks! EDIT: In...

How does Apple.com achieve their progressive jpeg loading?

javascript,html,css,jpeg
If you take a look at sites like this one http://www.apple.com/watch/overview/ you'll see that their .jpgs load unconventionally, starting with a pixelated version and slowly increasing in resolution instead of loading from top to bottom. In inspector, the images don't look special to me. Is this a certain way of...

libjpeg not exact pixel values even with quality of 100

colors,jpeg,rgb,grayscale,libjpeg-turbo
I am writing a program to read some text files and write it to a JPEG file using libjpeg. When I set the quality to 100 (withjpeg_set_quality), there is actually no quality degradation in grayscale. However, when I move to RGB, even with a quality of 100, there seems to...

IOError for savefig JPG in matplotlib

python,matplotlib,jpeg,canopy
I am trying to save a JPG and having issues. The following gives "IOError: encoder error -2 when writing image file" import matplotlib.pyplot as plt plt.plot([1, 2]) plt.savefig('image.jpg') It works with png so I tried to: pip install pillow as suggested here but it was already installed in Canopy. It...

Preventing JPEG Compression artefacts during binarization

opencv,jpeg
I am trying to use an binarize images similar to the following image: Basically, I want all non white to become black but threshold in OpenCV is giving fringing (JPEG Artifacts). I even tried Otsu thresholding but some parts of the colors don't work so well. Is there any simple...

Native PNG library on MacOSX (mavericks)

c,png,jpeg,osx-mavericks,tiff
I need to build an application which can read PNG files. On MacOSX mavericks the libpng is not available anymore (see). Is there any other way to read PNG file on MacOSX (Cocoa / Carbon Framework...). I'd rather stay with the native framework than download and compile a local libpng....

Hiding JPEG Image path - not working

php,jpeg,content-type
I am trying to hide the actual path of my image using the following piece of code: 11> $img = "http://mp4mobilemovies.net/screenshots/Badlapur - DvdScr.jpg"; 12> 13> $im = imagecreatefromjpeg($img); 14> 15> header('Content-Type: image/jpeg'); 16> 17> imagejpeg($im); But I get nothing, nothing in the sense of not even garbage ASCII, just blank....

How to convert .jpeg image to .jif in java? (Exif TO JFIF)

java,type-conversion,jpeg
From customer i have request to send images in .JIF format (JFIF) . I have java aplication, but i coould not google anithing to topic of how to convert to that image type, i could even hardly google anithing to ".JIF" format itself. EDITED : Can somebody advice how to...

Use Gulp-imagemin with imagemin-jpeg-recompress plugin?

jpeg,gulp,gulp-imagemin
I'm just experimenting with Gulp to simply optimize images. I find that imagemin-jpeg-recompress reduces JPGs more than the default optimizer that comes with gulp-imagemin. I'm wondering if there is a way to use gulp-imagemin but swap out the jpegtran plugin for the the imagemin-jpeg-recompress. I can't seem to find any...

Libjpeg write text at some specific position

c++,jpeg,libjpeg,libjpeg-turbo
Is there a way to output a text at some (x,y) position having a certain "size", such as a numeral '1'? For example in gnuplot, we can use plot ... using x:y:size w labels center... Is there something similar which I can use with the libjpeg library? ...

get picture from FTP server then convert to Bitmap in Android

android,bitmap,ftp,jpeg
Based on an answer on this thread, we can upload and download from FTP server: //UPLOAD try { FTPClient con = new FTPClient(); con.connect("192.168.2.57"); if (con.login("Administrator", "KUjWbk")) { con.enterLocalPassiveMode(); // important! con.setFileType(FTP.BINARY_FILE_TYPE); String data = "/sdcard/vivekm4a.m4a"; FileInputStream in = new FileInputStream(new File(data)); boolean result = con.storeFile("/vivekm4a.m4a", in); in.close(); if (result)...

Node.js - Detecting Image Optimization

javascript,node.js,image,optimization,jpeg
I am building an application which allows users to upload images to a post. My issue is that some of these images are 10MB plus. I am currently optimising these using a Node.js module which lowers the file size. It does this by re-creating the image with a quality score...

Compressing using JPEG but no quality degradation (MATLAB)

matlab,image-processing,jpeg,image-compression
Good day, I am trying to show that compressing an image many-many times (extremely many, as in 500 times), will show quality degradation. And from what I understand, this can happen when an image is saved many-many times in JPEG. I tried writing a MATLAB code to do this: clc;close...

Image size is increased when converted from jpg to webp with quality value 100

android,image,jpeg,webp
I want to replace my .png and .jpg files in android project with .webp to reduce the app size. I am verifying these 3 cases for jpg to webp conversion(for both .png and .jpg) : Lossy with 80% quality Lossy with 100% quality Lossless for Case 1, size was reduced...

huffmandict error The symbol and probability vector must have the same length

matlab,compression,jpeg
I'm implementing this code for JPEG compression, but I get the error ??? Error using ==> huffmandict at 97 The symbol and probability vector must have the same length this is the code, please help: function y = mat2huff(x) y.size = uint32(size(x)); x = round(double(x)); x = unique(x) xmin =...

Print/Show JPG file in R

r,jpeg,rvest
While using rvest package I am trying to print/show the lego_movie poster in R. I fail to do so. Here's my attempts: library(rvest) poster <- lego_movie %>% html_nodes("#img_primary img") %>% html_attr("src") ## 1st attempt library(jpeg) jpeg(poster) dev.off() ## 2nd attempt readJPEG(poster) dev.off() I think EBImage has display function. This package...

PHP imagick gif to jpg - background

php,jpeg,gif,imagick,alpha-transparency
I've this gif: https://dl.dropboxusercontent.com/u/76885657/stackoverflow/2.gif (transparent background) And with this code: $im = new Imagick(); $im->readimage("example.gif"); $im->setImageAlphaChannel(11); $im->setImageBackgroundColor('white'); $im->setImageFormat("jpg"); $im->stripImage(); $im->writeImage("example.jpg"); $im->clear(); $im->destroy(); Results: https*://dl.dropboxusercontent.com/u/76885657/stackoverflow/3.jpg(without *) (gold background) But want this:...

Creating base64 encoded JPG string from image from camera for upload

android,image,paperclip,bytearray,jpeg
I am building an Android app that takes photos, then uploads them to a Rails API. The api expects the base64 encoded raw file bytes, to be stored as a temp file representing the image in JPG format. However, the API is rejecting the uploaded file with this error message:...

Android: define image type (jpeg or jpeg2000) from inputstream

java,android,jpeg,inputstream,jpeg2000
I have an inputstream that contains image. Image can be as in jpeg, so in jpeg2000 format. I've logged that stream and see next for jpeg2000: ������jP for jpeg that it something like ������JFIF To my understanding, there should be some magic bytes in stream, that will return image type....

Why isn't the background image showing up?

java,jpanel,jpeg
I'm writing a program for a Hangman game and I want the background to be a JPEG image, rather than just a solid color. But when I run my program, the background image isn't showing up. Any thoughts? HangmanFigure.java import java.awt.*; import javax.swing.*; public class HangmanFigure extends JPanel { private...

OpenGL Texturing - some jpg's are being distorted in a strange way

python,opencv,opengl,numpy,jpeg
I am trying to draw a textured square using Python, OpenGL and GLFW. Here are all the images I need to show you. Sorry for the way of posting images, but I don't have enough reputation to post more than 2 links (and I can't even post a photo). I...

How do I use Oracle utl_file to write an image clob

jpeg,clob,utl-file
I have an Oracle Apex application which generates automated eMails. In Apex, the user inserts a JPG image into a rich text field. That image is saved into a CLOB field. When the stored procedure is called, it reads the JPG image and stores it into a local variable called...

Performimg image processing and save image with same compression factor using matlab

image,matlab,imagemagick,jpeg
I can read an Image's metadata and find the image quality with the following command in linux, which I think is from ImageMagick: identify -verbose image.jpg The output of this command is the following: ... Iterations: 0 Compression: JPEG **Quality: 96** ... The important thing to me is to find...

JPEG: YCrCb <-> RGB conversion precision

c++,colors,jpeg
I've implemented rgb->ycrcb and ycrcb->rgb conversion using JPEG conversion formulae from http://www.w3.org/Graphics/JPEG/jfif3.pdf (the same at: http://en.wikipedia.org/wiki/YCbCr (JPEG conversion)). When checking whether results are correct (original->YCrCb->RGB), some of pixels differ by one, e.g 201->200. Average percent of precision errors is 0.1%, so it's not critical. /// converts RGB pixel to YCrCb...

Adding footer/EXIF (binary data) to JPG image in C#

c#,.net,jpeg,.net-4.5
Hello all I have an image and I want to add binary data as a footer to that image. RGBImage rgbImage = (RGBImage) RGBImage.LoadImage(@"test.tiff"); byte[] bytes = File.ReadAllBytes(@"C:\TEMP\gili.bin"); int padding =(int) Math.Ceiling((double)bytes.Length/(rgbImage.Width*3)); byte[] newMakerNoteImage = new byte[rgbImage[0].Data.Length + (rgbImage.Width * 3 * padding)]; Buffer.BlockCopy(rgbImage[0].Data, 0, newMakerNoteImage, 0, rgbImage[0].Data.Length); Buffer.BlockCopy(bytes, 0,...

Extract multiple JPEG's from a single file

c#,vb.net,jpeg
I have 100's of files that have some data at the top then a series of images at the bottom. I need to read this data using either C# or VB and then write the individual images to a file. Here is a example of what the file looks like...

Android Studio: How can I add an image in the drawable/res folder?

android-studio,import,jpeg
I tried to copy and paste .jpg file to the drawable folder but i got this errors: E:\Projects\QuizApp\MyApplication\app\build\generated\source\r\debug\com\example\androbo\quizapp\R.java Error:(1452, 32) error: <identifier> expected Error:(1452, 37) error: illegal start of type Error:(1452, 38) error: <identifier> expected Error:(1453, 32) error: <identifier> expected Error:(1453, 40) error: <identifier> expected Error:(1454, 32) error: <identifier> expected...

imagecopyresampled not working not sure why

php,css,image,jpeg,php-gd
So I'm attempting to use imagecopyresampled to crop out a section of a photo so that I don't have to worry about my users uploading photos larger than intended to my website. Unfortunately I have yet to figure out why imagecopyresampled is basically behaving as though I simply resized the...

Wrong output size when plotting over an image in R

r,image,plot,png,jpeg
My goal is to read an image file in either the PNG or JPEG format and plot various data over said image and save it to disk. I also want the image to take up all available space in the produced plot, no axes or labels or anything. I'm a...

imagewebp (php) creates corrupted webp files

php,image,jpeg,corrupt,webp
Recently I've been fiddling with the WebP image format. I use php 5.5.12 for this, with the gd library installed (gd 2.1.0 / webp supported). I noticed that for some reason, PHP creates corrupted webp-images. The code I used is the following: $im= imagecreatefromjpeg("test_img.jpg"); $succes = imagewebp($im, "test_img.webp"); if ($im...

What's wrong with the image?

image,cross-browser,jpeg
I got a image: http://images.tyler.lu/iphone-4s-a.jpg It looks different in different browsers. Chrome IE What's wrong with the image?...

Is it possible to add a watermark on to a JPG without re-compression?

php,image-processing,jpeg,watermark,lossless-compression
It seems to be logical that it should be impossible to add a watermark to an JPG image without re-compressing the image when saving it as an JPG. Can someone confirm this? The question is generally related to PHP, but I don't think the server language makes a difference to...

BitmapFactory.DecodeByteArrayAsync JPEG is 77KB resulting Bitmap is 1.6MB

android,bitmap,xamarin,jpeg
I'm downloading some regular JPEG files and I have verified the file size. They are 77KB and can be viewed in my browser. ImageBytes.Length verifies this file size. However, imageBitmap.byteCount is 1638400 bytes. What am I missing? BitmapFactory.DecodeByteArrayAsync creates usable files, but they are huge. public async static Task<Bitmap> GetImageBitmapFromUrl(string...

How to get DCT-coefficients from Jpeg using Visual C# and LibJpeg.Net

c#,jpeg,dct
I need to get DCT-coefficients array after quantization for further changing bits (steganography). My question is: Lets say, i have jpeg image in picturebox or whatever. How can i acess to dct coef. of this image using C# and library like LibJpeg.Net? Need a code pls. Can't find anything complete...

Why does PNGing an image from a JPG make it 10x bigger?

png,jpeg,bmp
I have an image captured via webcam of my cat (the subject might not be important). I've aquired it as a 31 kB JPG file. When I open it with an image editor, then save it (without alteration) as a PNG (max. compression) it stores as a 297 kB file....

mpeg to jpeg conversion and the opposite

c++,jpeg,mpeg
I am implementing a program and i need to ''break'' an MPEG video to jpeg frames and then back to an MPEG video. It is also needed that the application for the ''breaking''can be opened through my initial program. Any ideas?

How to work with JPEG-LS in Java [closed]

java,jpeg
Is there any example how to work with JPEG-LS in java? Some library?

Swift - Reading .jpg image for pixel color returning incorrect values

image,swift,colors,jpeg,photoshop
I'm trying to get the UIColor of each pixel from a jpg image in swift, the following code successfully gets each pixel color however the results are confusing me: func renderLandscape() { var landscapeImage = UIImage(named: "test") for var xPos = 0 as CGFloat; xPos < landscapeImage?.size.width; xPos++ { for...

Open image with FLTK.lib's Fl_JPEG_Image

jpeg,fltk
Hi Im trying to use the FLTK library to draw a bunch of images. My problem is that I cannot open any *.jpg file with FLTK's Fl_JPEG_Image std::vector<Img> displayedImages; // my clas containning paths to images loaded from database std::vector<Fl_JPEG_Image*> images; std::vector<Fl_Box*> boxes; Fl_JPEG_Image im(displayedImages.at(i).getThumb().c_str()); // this line gives an...

open image with FLTK on windows

c++,jpeg,filepath,fltk
I'm having problem: I was trying to add image to my _fl_group_ but was not able to do so. I was trying to identify where the problem occurs and according to specification on fltk's webpage, if image is opened with fl_JPEG_image(const char* path) constructor correctly, calling im->w() should return >...