Export results from photoshop count

New Here ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

Hi Community,

 

I am working on my research where my advisor shared some images that have small holes in them and he counted them using Photoshop's count feature. I would like to export the data into a text/csv file with pixel location information or as an image file with the dots only (I do not need the numbers). Can anyone help me with what I should do? I found a script that transfers individual points into layers, however, I have around 10000 dots in each image and I do not think converting them into individual layers is a good idea.

 

Thank you so much for your help in advance. I really appreciate it.

TOPICS
Actions and scripting, Import and export, Windows

Views

263

Likes

Translate

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

correct answers 2 Correct Answers

Enthusiast , Apr 24, 2021 Apr 24, 2021
#target photoshop s2t = stringIDToTypeID; (r = new ActionReference()).putProperty(s2t('property'), k = s2t('countClass')); r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum')); var p = executeActionGet(r); if (p.hasKey(k)) { var counter = p.getList(k), n = (new File).saveDlg('Save file', '*.csv'); if (n) { if (n.open('w', 'TEXT')) { n.write('x;y\n') for (var i = 0; i < counter.count; i++) { var c = counter.getObject...

Likes

Translate

Translate
Adobe Community Professional , Apr 25, 2021 Apr 25, 2021
Change last 3 lines in my code from How to read position of all count items in document to: fle = File('~/desktop/.csv'), csv = ''; for(i = 0; i < count; i++) csv += [xy(i, 'x'), xy(i, 'y')] + (i - count + 1 ? '\n' : '') fle.open('w'), fle.write(csv), fle.close()

Likes

Translate

Translate
Adobe Community Professional ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

What do you mean by small holes? Are these dots filled with a uniform background color? Transparent?

Likes

Translate

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
New Here ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

defaultbvin7s4c0q55_0-1619292099738.png

Here is a sample image. These yellow dots are actually holes in the tissue. They are labelled and counted using Photoshop's count feature. Right now I have this in Photoshop. 

defaultbvin7s4c0q55_1-1619292343631.png

I need to export the markers (either as an image or pixel locations), without the numbers. Please let me know if you need anymore information.

 

 

 

Likes

Translate

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
Enthusiast ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

 

#target photoshop
s2t = stringIDToTypeID;

(r = new ActionReference()).putProperty(s2t('property'), k = s2t('countClass'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var p = executeActionGet(r);
if (p.hasKey(k)) {
    var counter = p.getList(k),
        n = (new File).saveDlg('Save file', '*.csv');
    if (n) {
        if (n.open('w', 'TEXT')) {
            n.write('x;y\n')
            for (var i = 0; i < counter.count; i++) {
                var c = counter.getObjectValue(i)
                n.write(c.getDouble(s2t('x')) + ';' + c.getDouble(s2t('y')) + '\n')
            }
            n.close()
        }
    }
}

 

Likes

Translate

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
New Here ,
Apr 25, 2021 Apr 25, 2021

Copy link to clipboard

Copied

LATEST

This worked perfectly. Thank you so much!!!!

Likes

Translate

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 Professional ,
Apr 25, 2021 Apr 25, 2021

Copy link to clipboard

Copied

Change last 3 lines in my code from How to read position of all count items in document to:

 

fle = File('~/desktop/.csv'), csv = ''; for(i = 0; i < count; i++)
	csv += [xy(i, 'x'), xy(i, 'y')] + (i - count + 1 ? '\n' : '')
fle.open('w'), fle.write(csv), fle.close()

 

Likes

Translate

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