Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
1

Black horizontal line across the image after save to tif

Explorer ,
Aug 10, 2024 Aug 10, 2024

Copy link to clipboard

Copied

Hi

 

I edited raw image & saved to tiff.  I had experience black horizontal line across the image.  

Sometimes it appeared & I had to redo again.

(MacOS Sonoma 14.4.1)

GinTay_072A8247.jpgexpand image

 

Please help

 

 

Views

1.1K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 06, 2025 Mar 06, 2025

Copy link to clipboard

Copied

quote

So to copy files back and forth is not really a workable option over time. 


By morten_2325


If you're happy to double check and re-render as necessary, which doesn't sound like a great option over time.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2025 Mar 06, 2025

Copy link to clipboard

Copied

Apart from using Adobe Bridge or another visual method to eyeball the results, it's possible to script this to various degrees. The following script will check selected files for pure black pixels and write the suspect file names and paths to a text file on the desktop. For processing speed, it will make a temporary crop of the canvas width to 3px wide before checking the histogram, which may not always be perfect and could lead to some false-positives being reported. Checking row by row for continuous black pixels would be very time prohibitive, even if downsampling and/or cropping to help speed things up.

 

/*
Log Files With Black Full Width Line to Text File Fast.jsx
Stephen Marsh
v1.0 - 7th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/black-horizontal-line-across-the-image-after-save-to-tif/m-p/15195817
Note: It is assumed that the documents are RGB mode
*/

#target photoshop

// Open dialog to select files
var theFiles = File.openDialog("Select files to check for full width 0r0g0b pixels", true);

if (theFiles) {
    processFiles(theFiles);
} else {
    alert("No files selected.");
}

// Function to check histogram for 0r0g0b
function checkHistogramForBlack(doc) {
    var histo = doc.histogram;
    return histo[0] > 0;
}

// Function to process files
function processFiles(theFiles) {
    var resultFile = new File(Folder.desktop + "/BlackPixelsCheckResults.txt");
    resultFile.open("w");
    resultFile.writeln("Files possibly containing full width 0r0g0b pixels:\n");

    // Counter for files with 0r0g0b pixels
    var blackFilesCount = 0;

    // Loop through files
    for (var i = 0; i < theFiles.length; i++) {
        var theFile = theFiles[i];
        var doc = app.open(theFile);

        // Resize canvas to 3px wide, yes it's a hack but it works much faster than looping through all pixels...
        // Some edge cases could be falsely logged, but it's probably good enough for most cases!
        doc.resizeCanvas(UnitValue(3, "px"), doc.height, AnchorPosition.MIDDLECENTER);

        if (checkHistogramForBlack(doc)) {
            resultFile.writeln(theFile.fsName);
            blackFilesCount++; // Increment counter when 0r0g0b pixels are found
        }
        doc.close(SaveOptions.DONOTSAVECHANGES);
    }

    // End of script notification
    resultFile.close();
    alert("Processing complete!\n" + "Total files checked: " + theFiles.length + "\n" +
        "Files with possible full width black pixels: " + blackFilesCount + "\n" +
        "Results saved to: " + resultFile.fsName);
    resultFile.execute();

}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

Copy link to clipboard

Copied

LATEST

Here's a slightly different take on the previous script, this one leverages colour range to load all pure black pixels as a selection and then compares the selection width to the document width. If both match, then the file is logged as possibly containing a black row. As with the previous code, this isn't perfect and there may be cases where false positives are flagged.

 

/*
Log Files With Black Full Width Line to Text File Slower.jsx
Stephen Marsh
v1.0 - 8th March 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/black-horizontal-line-across-the-image-after-save-to-tif/m-p/15195817
*/

#target photoshop

// Open dialog to select files
var theFiles = File.openDialog("Select files to check for full width 0r0g0b pixels", true);

if (theFiles) {
    processFiles(theFiles);
} else {
    alert("No files selected.");
}

// Function to check histogram for 0r0g0b
function checkHistogramForBlack(doc) {
    var histo = doc.histogram;
    return histo[0] > 0;
}

function selectColorRange(fuzziness, luminance, a, b, luminance2, a2, b2, colorModel) {
    var s2t = function (s) {
        return app.stringIDToTypeID(s);
    };
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var descriptor3 = new ActionDescriptor();
    descriptor.putInteger(s2t("fuzziness"), fuzziness);
    descriptor2.putDouble(s2t("luminance"), luminance);
    descriptor2.putDouble(s2t("a"), a);
    descriptor2.putDouble(s2t("b"), b);
    descriptor.putObject(s2t("minimum"), s2t("labColor"), descriptor2);
    descriptor3.putDouble(s2t("luminance"), luminance2);
    descriptor3.putDouble(s2t("a"), a2);
    descriptor3.putDouble(s2t("b"), b2);
    descriptor.putObject(s2t("maximum"), s2t("labColor"), descriptor3);
    descriptor.putInteger(s2t("colorModel"), colorModel);
    executeAction(s2t("colorRange"), descriptor, DialogModes.NO);
}

function processFiles(theFiles) {
    var resultFile = new File(Folder.desktop + "/BlackPixelsCheckResults.txt");
    resultFile.open("w");
    resultFile.writeln("Files possibly containing full width 0r0g0b pixels:\n");

    // Counter for files with 0r0g0b pixels
    var blackFilesCount = 0;

    // Loop through files
    for (var i = 0; i < theFiles.length; i++) {
        var theFile = theFiles[i];
        var doc = app.open(theFile);

        selectColorRange(0, 0, 0, 0, 0, 0, 0, 0);

        var selectionBounds = activeDocument.selection.bounds;
        var selectionWidth = selectionBounds[2].as("px") - selectionBounds[0].as("px");
        if (app.activeDocument.width.as("px") === selectionWidth) {
            resultFile.writeln(theFile.fsName);
            blackFilesCount++; // Increment counter when 0r0g0b pixels are found
        }

        doc.close(SaveOptions.DONOTSAVECHANGES);
    }

    // End of script notification
    resultFile.close();
    alert("Processing complete!\n" + "Total files checked: " + theFiles.length + "\n" +
        "Files with possible full width black pixels: " + blackFilesCount + "\n" +
        "Results saved to: " + resultFile.fsName);
    resultFile.execute();

}

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines