JPEGmini - future lossless compression?

I read an interesting technical artice today about the develpment of JPEGmini alogrithm, that supposdely will provide lossless compression, and can be read by any current software that reads a jpeg file.  THe article is rather technical, but that is good, as it sounds like a real deal rather than a magic concept.  Give it a read and post your comments on JPEGmini.  http://www.megapixel.co.il/english/archive/21907
Here is a couple of excerpts:
Q: How does the JPEGmini algorithm work?
A: The algorithms we have developed, on which we have filed 14 patent applications, simulate the human visual system.  Our technology analyzes each specific photo, and determines the maximum amount of compression that can be applied to the photo without creating any visual artifacts.  In this way, the system compresses each photo to the maximum extent possible without hurting the perceived quality of the photo.
Q: How much compression does JPEGmini enable?
A: Our technology can reduce the file size of photos by a factor of up to 5x without hurting their quality.  The amount of compression that our algorithms apply varies from photo to photo as mentioned above, buy you can estimate the average amount of compression according to the photo resolution, as described in the following table:
Photo   Resolution
Average   File Size Reduction Using JPEGmini
8MP   and more
70 – 80%
5-7MP
60 – 75%
3 MP
50 – 60%
2 MP
30-50%
1024×768
25 – 35%
800×600
20 – 25%
640×480 or less
10 – 20%

Curt Y wrote:
JPEGmini alogrithm, that supposdely will provide lossless compression
The compression is not lossless. The claim is that "the system compresses each photo to the maximum extent possible without hurting the perceived quality of the photo." The significant word is perceived. Quality loss will be dependent on the person doing the perceiving.

Similar Messages

  • Lightroom support for Nikon lossless-compressed NEFs

    Hi,
    I shoot in NEF (12-bit, no compression) with a Nikon D200.
    I then edit the files with Nikon Capture NX2, and, doing so, I save them as lossless compressed NEF.
    I then finish editing in View NX2, where I further add geotagging and star rating.
    I would like to import the NEF images straight into Lightroom 3.
    My need is only to use the database and slideshow functions of Lr3; I understand and accept that, if I want to re-edit the image, I must use Capture again.
    ONLY IN THE CASE I wanted to individually proceed editing in Lr3, I accept the need to extract the embedded jpeg and edit it in Lr3, ending up with two separate images.
    In principle, I do not want to duplicate all my images saving them twice also as jpeg.
    If I try now to import my lossless-compressed NEFs in Lr3.2, during import preview I can positively see the images, with editing applied. But after import, sometimes it shows an image composed solely by "noise", and sometimes it shows the image, but without any editing. If I open the individual image view, it always says "An error has occurred in elaboration of the image".
    For testing, I also tried to save the edited image as NEF non-compressed and import it; I do not obtain the "noise" images any more, but the images are shown in the original version, without editing.
    Only if I try to import the original images, it works.
    I do not understand such a strange behaviour, since if I use a much simpler program like ExifPro v1.1.11, everything works fine and also the LL-c NEFs are correctly shown, with edits.
    I also tried the NXTooey plugin by Rob Cole, but I end up duplicating my images as jpegs, and I do not want it (either I do not use it correctly?).
    Thanks for your help
    Danilo

    Thank you for your prompt answers
    @ Lee
    I can understand that the philosophy of Lr wants it to be a program for editing, and not merely for viewing - but, indeed, it is not ONLY an edit program (and for editing it has some features I like very much, and it is the reason why I would like to keep using it): it has also the database features, the slideshow, etc., so I cannot understand the intention to deliberately keep such a limitation: to me, such an option could be useful to many users, in many scenarios apart from editing.
    The feature could be offered as an optional setting for the user (use internal render - use embedded jpeg), so it is an enlargement of the capabilities of the program, and not a limitation.
    Moreover, in my understanding, it is not true that the edited raw images contain only the metadata relative to the editing infos: they certainly contain also an embedded jpeg (or tiff) of the edited image, ready to be extracted.
    Infact, programs like ExifPro show the image at 100% quality (not a thumbnail) with editing applied, and they are extremely fast. It is not possible that they have the capability:
    1) to fully understand the proprietary matadata - part of them are not even disclosed out of Nikon
    2) to apply them on the fly, always and without any misunderstanding
    3) perform such an heavy elaboration 10 to 20 times faster than Capture or Lr
    So,they instead certainly look into the file for an area where they know it is embedded the edited jpeg, ready and done.
    And this could be easily done in the same way also by Lr with minimal effort.
    Of course, I accept that, if I want to continue editing in Lr, (since it cannot understand the proprietary metadata), the embedded edited jpeg is extracted and saved, and from now on, I have two separate files that are no more in sincrony with editing.
    @ Rob
    The firmware of the D200 unfortunately does not have the option to save in NEF Lossless-compressed: either you save in NEF NON-compressed (12-bit),
    or you save in NEF LOSSY-compressed (apart from the options of saving in Jpeg)
    And so I do not want to save in LOSSY since I would lose infos.
    Yes I know that the more recent cameras have the option to save Lossless, and I would always use it indeed, if I had.
    Given that, I agree with you for what you say in the second part of your answer.
    But I would like to make the temptative anyway: I like very much Lr, it is a program full of options and opportunities (among them, the ability to edit
    in a powerful and fast way - who knows if I will abandon Capture in the future and adopt LR for some editings, and for others no)
    So: +1 vote: Lightroom option for persistent display of embedded jpeg (could it be offered as an option, or a flag to be checked in the settings??), and
    optional extraction for editing.
    And I will submit the "noise" phenomenon as a bug - Now I only have to find how to do it...
    Thank you again
    Danilo

  • Lossless compression of dng files like in Lightroom?

    Lightroom losslessly compresses DNG files to half their size, which is wonderful. Is there any way to get Aperture to do this?

    I remember seeing a plug-in to call the DNG converter from Aperture, but I think it never leaved the beta phase.
    Anyway, using Adobe's converter is no big deal, and it's free.

  • What is the best lossless compression for video?

    I have a large amount of captured video, which is saved in uncompressed format.
    I want to archive this video and I need to figure out what the best compression choice is.
    It's video only and I want the archived materials to be compressed as losslessly as possible and as small as possible. Losslessness is more important than size. The original material was captured in FCP from a video camera using Firewire. It is NTCS DV.
    Multiple angles of this source material were edited in FCP and rendered to make the final, uncompressed files. Those are what I need to compress and archive.
    Any suggestions would be appreciated.

    There is no such thing as lossless compression.
    This is not really true. There are many ways to compress - just google "compression algorithms" and you'll find some. Two basic schemes are either lossless or lossy. Lossless seeks to remove redundant or repetitive information, this is like Run Length Encoding or LZW encoding. Lossy throws away information that is generally "not perceived". JPEG, MPEG, H.264, DV are examples of lossy compression.
    YUV "lossless" is 4:2:2 and is considered uncompressed, yet it takes up less space than RGB 4:4:4 encoding. Simply zipping the file compresses it (uncompressed codecs squeeze better, but DV does compress, indicating redundant information) - a TIFF sequence might have run length encoding or LZW. Both are lossless.
    To get back to the question, Patrick:Losslessness is more important than size.
    H.264 is a fantastic compression - it is, however, FAR from lossless AND it is not directly editable. You'd need to convert it back to an editable format, ensuring even more loss. Not within the parameters of your desired solution...
    Patrick

  • DNG native camera lossless compression on import

    Hi. I have XP with  LR2.5 and Ps CS4 and ACR 5.5. My camera (Leica M8) produces DNG files as its native format.
    I am confused regarding methods to apply lossless compression to these DNG files. I have used this successfully previously but currently am unable to reproduce this function with LR2.
    I have lossless compression for DNG set in preferences. I am importing the files from the card and applying a change to the file, for example WB, then selecting update metadata and preview as a workaround. However file sizes do not appear to change.
    Since I have opened DNGs in another converter as well as in ACR too I am confused on where the lossless compression has been applied previously.
    I have successfully applied this compression with ACR in the past but am trying to learn the LR workflow.
    I am also unsure if I can have the lossless compression applied during import.
    Any pointers as to what I am now missing would be greatly appreciated.

    I don't think that in the workflow you describe there is any possibility for the data to become compressed by Lightroom. Updating metdata in a dng file does not touch the RAW data, so it is normal that the filesize does not change.
    I am also unsure if I can have the lossless compression applied during import.
    Any pointers as to what I am now missing would be greatly appreciated.
    You can set the import pane up to "copy photos as dng". I believe this recompresses the dng but I have never owned a camera that uses dng as its native format so I am not sure about that. Otherwise, you can after import "Convert photo to DNG" from the edit menu. This should also reconvert files that are already dng.

  • How does lightroom 4 deal with lossless compressed raw files

    how does lightroom 4 deal with lossless compressed raw files

    Ok, sorry about the vague question.  My concern is centered around a new camera purchase ( Nikon D810 ) which produces huge files.  I shoot in RAW and never use lossless compression only uncompressed RAW because of my conservative nature .  But now it looks like I will be using Lossless compressed to help deal with the file size.  So the question was based on fears of data lost.  Thanks for the replies, and they confirm what I already suspected. So now I can feel confident using lossless compression.
    Thanks

  • Cannot import lossless compressed RAW from Nikon D7100 purchased July 2014 into up-to-date Lightroom 5.5. Help!

    I have looked all over the web for this answer, but have failed to find it. I have a new Nikon D7100. I took photos with it using the lossless compressed RAW format. I transferred the files on my PC using Nikon Transfer. However, Lightroom 5.5. (on the same PC) will not import the files from their folder--like it does for JPEG files. Lightroom says my version is up-to-date. Help!

    No plug-in is needed to import RAW files from a Nikon D7100 to LR5.
    However, if you have used certain versions of Nikon software to move the photos from the camera to a hard disk, then this may be interfering, and causing LR to not recognize the photos. The solution is to import directly from the camera card to Lightroom (if the photos are still on the camera card), or if not try http://owl.phy.queensu.ca/~phil/exiftool/fix_corrupted_nef.html

  • Nikon NEF -- Uncompressed versus Lossless Compressed

    Hi,
    When processing Nikon NEF files in LR 4.1, will there be any difference between how LR handles Uncompressed files versus Lossless Compressed files?  It is my impression that Lossless Compressed is just that... no loss of anything due to compression.
    Any comments would be appreciated.
    Thank you.
    John

    I do too, which I probably should have mentioned in my original post.  The topic came up in a conversation over lunch with a photographer-friend who uses Canon RAW and wondered how there could be compression without loss.  That's what prompted my post.
    John

  • Rip music with Apple Lossless but compress when sending to my Ipod

    When I pull my music off a cd onto my computer via Itunes, I want to use Apple Lossless compression. When I want to sync the music to my ipod I want to compress down to 128kbps. How can I go about doing this?
    Rob

    I use two libraries - a 'Lossless' library and an 'iPod' library. I use a script (http://dougscripts.com/itunes/itinfo/ituneslibrarymanager.php) to toggle between them. This allows me to stream lossless at home over my network without being confused by two sets of each song.

  • Preserving original interlacing while compressing to MPEG-2 video?

    One of our partner companies seems to have trouble creating interlaced MPEG-2 .m2v files using Compressor -- it always comes out progressive, no matter what options are used. Perhaps a bit of (boring) background to understand the situation:
    We are a non-profit and currently negotiating with a third party to receive many hundreds of their videos for a streamable version of their video archive we're building. The originals are losslessly compressed and for some reason interlaced -- they were probably taken from Beta SP tape that way.
    Our archival system would like to take MPEG-2 as "high-quality" (comparatively) input and then renders to many formats (H.264 etc.) in many containers for streaming. We do deinterlacing on those input files, if they come interlaced.
    We would like to preserve this MPEG-2 file for future compression runs in future streaming formats that don't exist yet, so we think it makes sense to stay as close as possibe to the losslessly compressed original format that the third party gave us.
    Can Compressor preserve the interlacing that was in the lossless source file or is this pointless? Does Compressor need to deinterlace the material anyway in order to be able to compress?
    If there is no way to preserve the original interlacing and if a deinterlacing pass is part of the compression process anyway, then we'll ask for progressive material from Compressor, otherwise it would be nice to stay close to the source.
    Any opinion or information is much appreciated

    Thanks a lot for your response. Yes, it's 25 fps PAL video, I have one version in Apple Lossless and one in DV. So far I have tried the DV version, because I'm certain that one is interlaced. More tests with lossless follow today.
    But as I understand it, most codecs today are block-based and thus would need a non-interlaced full picture to work at all? It doesn't make sense to look for blocks in material that comes in cut up bits and pieces, one half-picture per frame? So from that perspective, it would make sense for Compressor to deinterlace the source material before encoding it anyway, whether we tell it to or not.
    Thanks for confirming that MPEG-2 output can be interlaced with Compressor, that's one less thing to worry about. What I'm left wondering is whether it is even mathematically possible to preserve the original interlacing through to the output MPEG-2
    I'm doubting this more and more.
    Probably using decent-quality deinterlacing in Compressor and making the resulting MPEG-2 progressive would do more to preserve the quality of the source material.

  • Logic future???

    Hello All,
    I'm a bit concerned about the future of logic.......will there be a logic pro 10?  Will apple offer support for this great product in the future??  I switched over from Cubase/Nuendo several years ago and have been really pleased with the layout and features of logic pro 9.  However, I noticed that logic express is gone and logic pro is now in the app store???....to me this suggests a decline in support.  I wouldn't think the app store would be an option when considering a pro DAW.
    I also noticed that the Logic ads in gear magazines have gotten smaller......though this could be a result of not having an update in a while still I am concerned........Does anyone know what's going on?
    thanks
    "C"

    cpmusicSW wrote:
    Hello All,
    I'm a bit concerned about the future of logic.......will there be a logic pro 10?  Will apple offer support for this great product in the future??  I switched over from Cubase/Nuendo several years ago and have been really pleased with the layout and features of logic pro 9.  However, I noticed that logic express is gone and logic pro is now in the app store???....to me this suggests a decline in support.  I wouldn't think the app store would be an option when considering a pro DAW.
    I also noticed that the Logic ads in gear magazines have gotten smaller......though this could be a result of not having an update in a while still I am concerned........Does anyone know what's going on?
    thanks
    "C"
    If they were going to dump Logic, they wouldn't still be releasing updates nor would they have put in the work to put it on the app store.
    Express is gone because now Logic is cheap enough for hobbyists to buy the full version, and they'll only need to support one app.  The only thing that bothers me about the app store version is that more content is lossless compressed, although some of the content was in that format already in the disk version.
    I assume 10 is coming although with 9 going on the app store now I suspect it won't be soon.

  • Errors when trying to mosaic compressed images

    I am trying to load georaster data into Oracle 11g 11.2.0.2. I was successful then doing this by using the following steps:-
    - SDO_GEOR.IMPORTFROM
    - sdo_geor.mosaic
    However when I try to compress the images as JPEG-B I get an Oracle error when performing the mosaic operation.
    ORA-13485: error occurred during compression or decompression: lossy then something related to colormaps.
    Has anyone ever seen a similar error.
    These are the scripts.
    set serveroutput on size 1000000;
    set timing on;
    LOAD
    -- THE SDO_RASTER TABLE HAS TO BE UNIQUE IN THE ENTIRE DATABASE
    DROP TABLE GEO_25K PURGE;
    DROP TABLE RDT_25K PURGE;
    CREATE TABLE GEO_25K ( ID NUMBER PRIMARY KEY,
         SOURCE_FILE VARCHAR2(80),
         DESCRIPTION VARCHAR2(32),
         GEOMMBR SDO_GEOMETRY,
         GEORASTER SDO_GEORASTER);
    CREATE TABLE RDT_25K OF SDO_RASTER
         (PRIMARY KEY (RASTERID, PYRAMIDLEVEL, BANDBLOCKNUMBER, ROWBLOCKNUMBER, COLUMNBLOCKNUMBER))
         LOB(RASTERBLOCK) STORE AS (NOCACHE NOLOGGING);
    CALL SDO_GEOR_UTL.CREATEDMLTRIGGER('GEO_25K','GEORASTER');
    -- IMPORTFROM DOES NOT SUPPORT JPG ONLY TIFF, GIF, BMP AND PNG
    -- SET TIMING ON IN SQLPLUS TO SEE HOW LONG THE LOAD TAKES
    -- 28 X JPG CONVERTED TO TIFF REPRESENTS 1.93GB ON DISK AND 2286MB IN THE DB AND TOOK 1 HOUR 11 MINUTES TO LOAD
    DECLARE
         TYPE FILE_LIST IS TABLE OF VARCHAR2(200);
         files FILE_LIST;
         geor MDSYS.SDO_GEORASTER;
    BEGIN
         dbms_java.set_output(1000000);
         get_dir_list('/PRLR01/fssa01/RASTER/LOAD/');
         FOR i in ( SELECT rownum,FILENAME from dir_list where FILENAME like '%TIF' )
         LOOP
              dbms_output.put_line(i.FILENAME);
              dbms_output.put_line(SUBSTR(i.filename, 1, LENGTH(i.filename)-4) || '.TFW');
              INSERT INTO GEO_25K VALUES (i.rownum, i.filename, '', null, MDSYS.SDO_GEOR.INIT('RDT_25K', i.rownum));
              SELECT GEORASTER INTO geor FROM GEO_25K WHERE ID = i.rownum FOR UPDATE;
              MDSYS.SDO_GEOR.IMPORTFROM(geor, 'compression=JPEG-B', 'TIFF', 'FILE', i.FILENAME,
                   'WORLDFILE', 'FILE', SUBSTR(i.filename, 1, LENGTH(i.filename)-4) || '.TFW');
              UPDATE GEO_25K SET GEORASTER = geor WHERE ID = i.rownum;
              SELECT GEORASTER INTO geor FROM GEO_25K WHERE ID = i.rownum FOR UPDATE;
              MDSYS.SDO_GEOR.SETRASTERTYPE(geor, 21001);
              UPDATE GEO_25K SET GEORASTER = geor WHERE ID = i.rownum;
              SELECT georaster INTO geor FROM GEO_25K WHERE id = i.rownum FOR UPDATE;
              sdo_geor.setModelSRID(geor, 81989);
              UPDATE GEO_25K SET georaster = geor WHERE id=i.rownum;
         END LOOP;
         COMMIT;
    END;
    MOSAIC
    set timing on;
    --After the GeoRaster are loaded you may want to set the appropriate SRID if this was not set correctly.
    --SELECT sdo_geor.validateBlockMBR(georaster), id FROM GEO_25K;
    --select id, sdo_geor.getModelSRID(georaster) from GEO_25K;
    --Then you need to validate the GeoRasters to see if they have been setup correctly.
    --SELECT t.id, sdo_geor.validategeoraster(t.georaster) isvalid from GEO_25K t order by id;
    --After you have loaded all the georasters, iSMART will pick up each row of the georaster as an individual layer so you need to create a mosaic layer or table
    drop table GEO_MOSAIC_25K;
    drop table RDT_MOSAIC_25K;
    CREATE TABLE GEO_MOSAIC_25K ( ID NUMBER PRIMARY KEY,
    SOURCE_FILE VARCHAR2(80),
    DESCRIPTION VARCHAR2(32),
    GEOMMBR SDO_GEOMETRY,
    GEORASTER SDO_GEORASTER);
    CREATE TABLE RDT_MOSAIC_25K OF SDO_RASTER
    (PRIMARY KEY (RASTERID, PYRAMIDLEVEL, BANDBLOCKNUMBER, ROWBLOCKNUMBER, COLUMNBLOCKNUMBER))
    LOB(RASTERBLOCK) STORE AS (NOCACHE NOLOGGING);
    call sdo_geor_utl.createDMLTrigger('GEO_MOSAIC_25K','GEORASTER');
    DECLARE
    gr sdo_georaster;
    BEGIN
    insert into GEO_MOSAIC_25K (id, georaster)
    values (1, sdo_geor.init('RDT_MOSAIC_25K'))
    returning georaster INTO gr;
    sdo_geor.mosaic('GEO_25K', 'georaster', gr, '');
    update GEO_MOSAIC_25K SET georaster=gr where id=1;
    commit;
    END;
    --Then you need to validate the mosaic.
    -- SELECT sdo_geor.validateBlockMBR(georaster), id FROM GEO_MOSAIC_25K;
    SELECT t.id, sdo_geor.validategeoraster(t.georaster) isvalid from GEO_MOSAIC_25K t order by id;
    --The in order to achieve real performance you need to pyramid the mosaic raster. If you don't specify a pyramid level then you oracle will calculate it.
    --If you have set them max resolution to this layer using the Oracle calculated value will produce too many pyramid levels, you need to calculate how many pyramid value you will need
    --See URL for Pyramiding http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28398/geor_intro.htm#CHDDEGJJ
    DECLARE
    gr sdo_georaster;
    BEGIN
    SELECT georaster INTO gr
    FROM GEO_MOSAIC_25K WHERE id = 1 FOR UPDATE;
    -- Generate pyramids.
    sdo_geor.generatePyramid(gr, 'rLevel=5, resampling=NN');
    -- Update the original GeoRaster object.
    UPDATE GEO_MOSAIC_25K SET georaster = gr WHERE id = 1;
    COMMIT;
    END;
    quit
    These work fine until I include 'compression=JPEG-B'
    Cheers,
    David

    Check document:
    1.10.2 DEFLATE Compression of GeoRaster Objects
    DEFLATE compression compresses objects according to the Deflate Compressed Data Format Specification (Network Working Group RFC 1951), and it stores the compressed data in ZLIB format, as described in the ZLIB Compressed Data Format Specification (Network Working Group RFC 1950). The ZLIB header and checksum fields are included in the compressed GeoRaster object.
    Although DEFLATE compression is supported for GeoRaster objects of any size, the total size (columnsPerBlock * rowsPerBlock * bandsPerBlock * cellDepth / 8) of each block of the GeoRaster object must not exceed 1 gigabyte (GB). For large GeoRaster objects, you can call the SDO_GEOR.changeFormatCopy procedure to block the GeoRaster object into blocks smaller than1 GB, and then compress the GeoRaster object; or you can perform the blocking and compression in the same call to the SDO_GEOR.changeFormatCopy procedure.
    Because DEFLATE compression is lossless, compression quality does not apply, and is ignored if it is specified.
    compression
    Specifies the compression type to be applied to the GeoRaster object. Must be one of the following values: JPEG-B, JPEG-F, DEFLATE, or NONE. (You can use NONE to decompress a compressed GeoRaster object.) If compression is not specified, the compression type of the source GeoRaster object is used. For more information about compression and decompression, see Section 1.10. Example: compression=DEFLATE

  • I cannot remove embedded barcode from the image. Due to saving compression.

    Hi guys,
    I recreate a thread to prevent confusing on my previous one. Please only reply to this thread thanks.
    Ok, for a start I will give some general description about the application I made.
    I had some problem with the image being compressed while it is saved.
    Because saving an image will cause it to compress and had its pixel valued changed, I could not successfully remove the bardcode that is embedded inside a image(although some of the pixel value will be returned to original normally). I had placed my code below and will accept any opinion that will help me solve the removal of barcode problem.
    What my application does is actually very simple. It will take the pixel value of the area inside the image that will be embed with the barcode first, then it will take the pixel value of the barcode and use the formula (1-alpha * Image pixel value) + (alpha * barcode pixel value) = new pixel value which will contain the barcode that had been embedded inside. The formula works great but when I saved the image the pixel value will change due to compression. On the removal of barcode my application will read every pixel value from the image embedded with barcode (only the area with barcode embedded), then it will go on to read every pixel value of the barcode used for embedding and then use the formula (Embedded image pixel value - (alpha * Barcode pixel value) - (1 - alpha) = original pixel value. But due to the reason that compression will change some of the pixel inside the saved image to drop in its value, the result from the removal formula will be negative and hence caused my result image to become wierd as it will red colors instead of original color on some of its pixel. I tried saving under PNG format which people said to be lossless compression but the result is still the same.
    So I need to ask you guys for opinion or help me find the part where I actually did wrongly and caused the image pixel value to change.
    Thanks. Please proceed and read below for the codes that I used. It is messy and I will sort it out later.
    When alpha is set as 1 the barcode will appear to be overwrite onto the image. But when alpha is set as 0.1 the barcode will appear to be transparent and almost seems to be not there on the image when embedded.
    This is the code I used to retrieve image pixel when embedding:
    public static int[] getImagePixelValue(BufferedImage image, int x, int y){
              //Create an array to store image RGB value
              int[] imageRGB = new int[3];
              //Get height and width from input image
              int imageWidth = image.getWidth();
              int imageHeight = image.getHeight();
              //Get raw RGB value from image
              int imageValue = image.getRGB(x, y);
              //Convert image raw RGB value
              int imageRed = ((image.getRGB(x, y) >> 16) & 0xff);
              int imageGreen = ((image.getRGB(x, y) >> 8) & 0xff);
              int imageBlue = image.getRGB(x, y) & 0xff;
              //Input the converted RGB value into the array
              imageRGB[0] = imageRed;
              imageRGB[1] = imageGreen;
              imageRGB[2] = imageBlue;
              /*//Print out the pixel value to check
              System.out.println("Image red pixel: "+imageRGB[0]);
              System.out.println("Image green pixel: "+imageRGB[1]);
              System.out.println("Image blue pixel: "+imageRGB[2]);*/
              //Return image RGB value
              return imageRGB;
    }This is the code I used to retrieve barcode pixel for embedding:
    public static int[] getWatermarkPixelValue(BufferedImage watermark, int x, int y){
              //Create an array to store watermark RGB value
              int[] watermarkRGB = new int[3];
              //Get height and width from input watermark
              int watermarkWidth = watermark.getWidth();
              int watermarkHeight = watermark.getHeight();
              int watermarkValue = watermark.getRGB(x, y);
              //Convert watermark raw RGB value
              int watermarkRed = ((watermark.getRGB(x, y) >> 16) & 0xff);
              int watermarkGreen = ((watermark.getRGB(x, y) >> 8) & 0xff);
              int watermarkBlue = watermark.getRGB(x, y) & 0xff;
              //Input the converted RGB value into the array
              watermarkRGB[0] = watermarkRed;
              watermarkRGB[1] = watermarkGreen;
              watermarkRGB[2] = watermarkBlue;
              /*//Print out the pixel value to check
              System.out.println("Watermark red pixel: "+watermarkRGB[0]);
              System.out.println("Watermark green pixel: "+watermarkRGB[1]);
              System.out.println("Watermark blue pixel: "+watermarkRGB[2]);*/
              //Return watermark RGB value
              return watermarkRGB;
         }This is the code I used for merging the image pixel and barcode pixel to get the embedded pixel value:
    public static int[] getEmbeddedPixelValue(int[] imagePixelValue, int[] watermarkPixelValue, double alpha){
              //Create a object to hold embedded pixel value
              int[] embeddedRGBValue = new int[3];
              //Change image pixel value into double calculating equation
              double imgRedValue = (double) imagePixelValue[0];
              double imgGreenValue = (double) imagePixelValue[1];
              double imgBlueValue = (double) imagePixelValue[2];
              //Change watermark pixel value into double calculating equation
              double wmRedValue = (double) watermarkPixelValue[0];
              double wmGreenValue = (double) watermarkPixelValue[1];
              double wmBlueValue = (double) watermarkPixelValue[2];
              //Equation for embedding image and watermark together
              double embeddedRed = ((1.0 - alpha) * imgRedValue) + (alpha * wmRedValue);
              double embeddedGreen = ((1.0 - alpha) * imgGreenValue) + (alpha * wmGreenValue);
              double embeddedBlue = ((1.0 - alpha) * imgBlueValue) + (alpha * wmBlueValue);
              //Changing embedded value from double to int
              int embeddedRedValue = (int) embeddedRed;
              int embeddedGreenValue = (int) embeddedGreen;
              int embeddedBlueValue = (int) embeddedBlue;
              //input the embedded RGB value into the array
              embeddedRGBValue[0] = embeddedRedValue;
              embeddedRGBValue[1] = embeddedGreenValue;
              embeddedRGBValue[2] = embeddedBlueValue;
              //Return embedded pixel value
              return embeddedRGBValue;
         }This is the code where I used for the embedding process:
    else if(target == embedButton){
                   String xCoordinate = JOptionPane.showInputDialog(embedButton, "Enter coordinate X", "When you want to embed the watermark?", JOptionPane.QUESTION_MESSAGE);
                   String yCoordinate = JOptionPane.showInputDialog(embedButton, "Enter coordinate Y", "When you want to embed the watermark?", JOptionPane.QUESTION_MESSAGE);
                   int xValue = Integer.parseInt(xCoordinate);
                   int yValue = Integer.parseInt(yCoordinate);
                   int wCounter = 0;
                   int hCounter = 0;
                   //Create file object to be used in embedding and removing watermark
                   File inputImage = new File(imagePath);
                   File inputWatermark = new File(watermarkPath);
                   //Convert string into double for calculation of embedded pixel value
                   try {
                        alphaDouble = Double.valueOf(alphaValue).doubleValue();
                   catch (NumberFormatException nfe) {
                        System.out.println("NumberFormatException: " + nfe.getMessage());
                   try{
                        //Define selected image as testPic and make java read the file selected
                        BufferedImage image= ImageIO.read(inputImage);
                        BufferedImage watermark= ImageIO.read(inputWatermark);
                        BufferedImage testing;
                        //Get height and width value from the selected image
                        int imageWidth = image.getWidth();
                        int imageHeight = image.getHeight();
                        //Get height and width value from the selected barcode
                        int watermarkWidth = watermark.getWidth();
                        int watermarkHeight = watermark.getHeight();
                        int totalWidth = watermarkWidth + xValue;
                        int totalHeight = watermarkHeight + yValue;
                        //Use nested for loop to get RGB value from every pixel that the barcode will be embedded in the selected image
                        if(totalWidth <= imageWidth && totalHeight <= imageHeight){
                             for (int h = yValue ; h < totalHeight; h++){
                                  for (int w = xValue; w < totalWidth; w++){
                                       int[] imagePixelValue = getImagePixelValue(image, w, h);
                                       int[] watermarkPixelValue = getWatermarkPixelValue(watermark, wCounter, hCounter);
                                       int[] embeddedPixelRGBValue = getEmbeddedPixelValue(imagePixelValue, watermarkPixelValue, alphaDouble);
                                       setRed(image, w, h, embeddedPixelRGBValue[0]);
                                       setGreen(image, w, h, embeddedPixelRGBValue[1]);
                                       setBlue(image, w, h, embeddedPixelRGBValue[2]);
                                       wCounter++;
                                       if(wCounter == watermarkWidth){
                                            wCounter = 0;
                                            hCounter++;
                        else{
                             JOptionPane.showMessageDialog(embedButton, "The watermark cannot be embedded at the coordinates.");
                        tempImage = image;
                        imageIcon = new ImageIcon(tempImage);
                        labelImage.setIcon(imageIcon);
                        imagePanel.add(labelImage);
                        container.add(imagePanel, BorderLayout.CENTER);
                        setVisible(true);
                        System.out.println("Embedding completed");
                   catch(Exception errorEmbedding){
                        //If there is any error, the try and catch function will tell you the error
                        System.out.println("The following error occured: "+errorEmbedding);
              }This is the code I use to save the image that had been embedded with the barcode:
    else if(target == saveAction){
                   JFileChooser chooser = new JFileChooser();
                   FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG & GIF Images", "jpg", "gif");
                   chooser.setFileFilter(filter);
                   chooser.setCurrentDirectory(new File("."));
                   int returnVal = chooser.showSaveDialog(getParent());
                   if(returnVal == JFileChooser.APPROVE_OPTION) {
                        String name = chooser.getSelectedFile().getAbsolutePath();
                        //Create a string instant to hold outputImage path name
                        String saveFile = chooser.getSelectedFile().getName()+"."+fileType;
                        //Create file output to decide what name will be used to save the file
                        File outputImage = new File(saveFile);
                        try{
                             //Save the file with the name used
                             ImageIO.write((RenderedImage) tempImage,fileType,outputImage);
                        catch(Exception errorSaving){
                             //If there is any error, the try and catch function will tell you the error
                             System.out.println("The following error occured: "+errorSaving);
                   else{
              }This is the code I used for removal process of barcode:
    else if(target == removeButton){
                   //Create file object to be used in embedding and removing watermark
                   File inputImage = new File("removalTesting.jpg");
                   //File inputWatermark = new File(watermarkPath);
                   //Used a defined barcode for testing of removing barcode from embedded image
                   File inputWatermark = new File("barcode.jpg");
                   /*//Convert string into double for calculation of embedded pixel value
                   try {
                        alphaDouble = Double.valueOf(alphaValue).doubleValue();
                   catch (NumberFormatException nfe) {
                        System.out.println("NumberFormatException: " + nfe.getMessage());
                   //Used a defined alpha value for testing of removing barcode from embedded image
                   //alphaDouble = 0.5;
                   //Create x and y value for the starting coordinates of barcode embedded in the embedded image
                   int xValue = 0;
                   int yValue = 0;
                   int wCounter = 0;
                   int hCounter = 0;
                   try{
                        //Define selected image as testPic and make java read the file selected
                        BufferedImage image= ImageIO.read(inputImage);
                        BufferedImage watermark= ImageIO.read(inputWatermark);
                        //Get height and width value from the selected image
                        int imageWidth = image.getWidth();
                        int imageHeight = image.getHeight();
                        //Get height and width value from the selected barcode
                        int watermarkWidth = watermark.getWidth();
                        int watermarkHeight = watermark.getHeight();
                        int totalWidth = watermarkWidth + xValue;
                        int totalHeight = watermarkHeight + yValue;
                        //Use nested for loop to get RGB value from every pixel that the barcode had been embedded in the embedded image
                        if(totalWidth <= imageWidth && totalHeight <= imageHeight){
                             for (int h = yValue ; h < totalHeight; h++){
                                  for (int w = xValue; w < totalWidth; w++){
                                       int[] imagePixelValue = getImagePixelValue(image, w, h);
                                       int[] watermarkPixelValue = getWatermarkPixelValue(watermark, wCounter, hCounter);
                                       int[] removedPixelRGBValue = getOriginalImagePixelValue(imagePixelValue, watermarkPixelValue, alphaDouble);
                                       setRed(image, w, h, removedPixelRGBValue[0]);
                                       setGreen(image, w, h, removedPixelRGBValue[1]);
                                       setBlue(image, w, h, removedPixelRGBValue[2]);
                                       wCounter++;
                                       if(wCounter == watermarkWidth){
                                            wCounter = 0;
                                            hCounter++;
                        tempImage = image;
                        imageIcon = new ImageIcon(tempImage);
                        labelImage.setIcon(imageIcon);
                        imagePanel.add(labelImage);
                        container.add(imagePanel, BorderLayout.CENTER);
                        setVisible(true);
                        System.out.println("Embedding completed");
                   catch(Exception errorEmbedding){
                        //If there is any error, the try and catch function will tell you the error
                        System.out.println("The following error occured: "+errorEmbedding);
              }Sorry if the codes are in a mess, I did not had the time to sort it out yet but most likely do it when I got the removal of barcode done.
    Follow this link to have a look of the result I see in my application when I got the barcode embedded into the image I selected:
    [http://img356.imageshack.us/my.php?image=beforeremovalresultmg2.jpg]
    Follow this link to have a look of the result I see in my application after I got the barcode removed:
    [http://img523.imageshack.us/my.php?image=removalresultmx4.jpg]
    As you can see from the link, after I remove the barcode from the image. Some of the pixel actually went back to normal in the barcode area when the the barcode is embedded into the image. But some pixel in the barcode area had its value changed due to compression when I save the image file I think.
    Anyone can help me find out the problem?
    Thanks.

    KamenRider wrote:
    I suspect the problem lies in the code when I save the image. Because people said that PNG was loseless compression but when I saved in PNG some of the pixel went back to normal while some did not. This is obviously the cause from changing of pixel value when I saved the image.You are almost certainly wrong. This is trivially easy to check. Print out the color of a certain pixel immediately before you save it. Open the saved PNG in your favorite image manipulation program and check the saved value of that same pixel. When you re-load the saved PNG, print out the color again. It should be unchanged.
    Thanks you for trying to help me spot the problem but the formula is correct. The alpha value i used in my application is used to set the transparency of the barcode that will be embedded in the image. Hence, when alpha = 1 the new pixel value should be the barcode value. ^^The formula isn't wrong, it's just not doing what you think it's doing. Remember that you're working with ints here, not floating point numbers, so they have finite precision. When you case from double to int, fractions are dropped. As morgalr pointed out, your formula is:
    (1-alpha * Image pixel value) + (alpha * barcode pixel value) = new pixel value You didn't show us the code for getOriginalImagePixelValue but I imagine it's:
    original pixel value = (new pixel value - alpha * barcode pixel value) / (1 - alpha)On a piece of paper, take alpha = 0.9, image pixel = 17 and barcode pixel = 100. Calculate out what you should get for new pixel value and then calculate what you should get for original pixel value. You will find they don't match.

  • NEF --- DNG Conversion: Is it lossy or lossless?

    I was recently reading on a Nikon Forum where a writer stated that some data is lost when converting to DNG in Lightroom. His comments follow.
    I'd appreciate if some of the seasoned experts here would offer an opinion, and hopefully, a rebuttal. Thanks for any information you can share on this subject
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Every compression algorith is flawed if a single bit is lost and the original can not be recreated. Since the DNG converter must know about your camera model and it actually converts the NEF into an image before compressing the image, AND you can not, after converting to DNG convert back to original NEF, it is to me obvious that it is indeed a lossy compression, not just 'simple' data compression like zip, tar or whatever other type of data compression you want to compare with, which is truly lossless.
    The Nikon lossless compression works entirely on data compression principle, preserving every bit and recreating every bit of data when you edit the raw image, and that can not be done once the image is converted to DNG. That is why many people, who use DNG, also preserve the original NEF, which in my opinion, is a totally pointless work flow. The only reason I can see to use DNG is the ability to share the image with somebody else who is not able to edit NEF, but I might as well use TIFF in that case.
    The DNG converter must have knowledge of the camera model concerned, and be able to process the source raw image file, including key metadata to be able to convert and compress. A real lossless compression algorithm NEVER looks at the contents of the data because it is totally irrelevant for the converter to know what type of data you convert and try to compress, since it is based on mathematical patterns and statistics only.
    I look at DNG like I look at PDF. A Word document, especially with photographs in it, can be converted to PDF and it may look like you have not lost anything, but yes, you have lost a lot actually and you can never ever recreate the original Word document with the same quality like you have had in your original.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    727737757 wrote:
    The only reason why I convert NEF to DNG is that I like *not* having sidecar files.
    A perfectly valid reason to convert to DNG, in my opinion.
    And if you are using in Adobe software, you will notice no ill side-effects (e.g. no data loss) whatsoever, so I think you can have full confidence..
    But to offer a little more explanation:
    The DNG converter needs to know the camera model because it's doing a lot more than "zipping" up the raw data. e.g. it's also creating a camera profile, and interpreting white balance..
    Obviously, lossy compression is, well, lossy - I was talking about the lossless compression of raw data, which is 100% perfectly lossless (not a single bit is dropped..).
    But if you open a NEF in Aperture, you can see the focus point. If you open the converted DNG, you can't. Not because the focus point information is not in the DNG file, but because it's not in a prescribed place where Aperture can find it - so you could say it's "lost" for practical purposes, although that's not how I think of it.
    Cheers,
    Rob

  • Not working in collection: "is not" & "Digital Negative/Lossy compressed"

    Hello guys,
    I have a smart collection in LR4. The collection contains 200 pictures. I want to search inside the collection for all files which are NOT Lossy compressed (like raw, jpeg,dng lossless compressed etc). If I put as a rule the "is not" "Digital Negative/Lossy compressed" I will get all the files in the catalog. If I put as a rule the "is" "Digital Negative/Lossless" the result will be DNG/Lossless. The 1st rule seems not to be working. The same is for Fast load data, which seems for some files to be working and for some not. Anyone can explain it, or it is a bug?
    Boris

    Hi Carl,
    Based on my tests, only users allowed to use specific applications are able to see those application on the Web Access page.
    In my case, I published three remote application, and I only allowed Administrator to access one of them as below:
    After that, I logged on as administrator to RD Web Access, only one application was showing:
    I suggest you double check the user assignment on the application, make sure no other group is configured, then log off the user and log on to access RD Web Access again.
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

Maybe you are looking for

  • Windows 8.1 won't boot after VS 2013 express for windows (metro) installation

    I have purchased HP Pavilion e115sm  with AMD A-10 processor and 12GB of RAM notebook, installed windows 8.1 on it, i updated windows with "windows update" and installed all drivers needed. After that, i have tried to install VS 2013 express for wind

  • Using Runtime.Exec() on a JSP page

    I need to run a command on a JSP page. The source code is: <%@ page contentType="text/html;charset=WINDOWS-1252"%> <%!class StreamGobbler extends Thread InputStream is; String type; StreamGobbler(InputStream is, String type) this.is = is; this.type =

  • Interface not working with mavericks 10.9.3

    is there anything apple can do i have pro fire 610 on mavericks upgrade os x 10.9.3 but driver no good and no updates help!!

  • Windows size / resolution when connecting via scvmm console

    Hi right... please see attached screenshot for my problem.. As you can see... the windows is the usual size, but the server VM it is displaying is not showing as it should.. something has gone wrong with the display settings.. The only resolution I'v

  • T500 BIOS Update Question

    I hope this has not been asked before as the Search option is slow tonight ..... What is the difference between the 2 variants of the the latest Lenovo Posted BIOS (3.22 and 3.24) as described below and also what is the difference between the 6F and