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

How do I copy an image from the reference line to a new layer?

Participant ,
Jul 24, 2024 Jul 24, 2024

 

00.jpg

In an image, I have drawn reference lines using a newly created reference line layout, including both horizontal and vertical lines. How can I use a script to copy the images from these reference lines to a new layer? I have manually operated this in the image, and I understand the basic principle, but I'm unsure how to write it. My idea is to first obtain the coordinates of the reference lines, then check for the existence of either vertical or horizontal reference lines, and finally copy the images from the reference lines to a new layer. Thank you all for your help.

TOPICS
Actions and scripting
598
Translate
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

Community Expert , Jul 24, 2024 Jul 24, 2024
quote

Thank you for your reply. I hope to use a script to split the images within the reference lines into multiple layers


By @w30290083o9nn

 

Something like this?

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-slice-a-very-large-poster/m-p/10998357

 

Translate
Adobe
Community Expert ,
Jul 24, 2024 Jul 24, 2024

These "reference lines" are either known as a guide or guides – so for scripting and also just explaining things to other users, the correct and expected terminology is important. Here is some info on them from a legacy ExtendScript DOM .jsx scripting perspective (the new .psjs UXP scripting is different):

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/Guide.html

https://theiviaxx.github.io/photoshop-docs/Photoshop/Guides.html

 

I can see that the layers and the guides have a relationship, however, it is unclear why you wish to use guides to copy layers. 

 

What is the problem that you are trying to solve with scripting? What is the starting point? What is the desired outcome?

Translate
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
Participant ,
Jul 24, 2024 Jul 24, 2024

Thank you for your reply. I hope to use a script to split the images within the reference lines into multiple layers

Translate
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 ,
Jul 24, 2024 Jul 24, 2024
quote

Thank you for your reply. I hope to use a script to split the images within the reference lines into multiple layers


By @w30290083o9nn

 

Something like this?

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-slice-a-very-large-poster/m-p/...

 

Translate
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
Participant ,
Jul 24, 2024 Jul 24, 2024

Thank you, that's exactly what I was looking for. I really appreciate it.

Translate
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 ,
Jul 24, 2024 Jul 24, 2024
quote

Thank you, that's exactly what I was looking for. I really appreciate it.


By @w30290083o9nn

 

You're welcome!

 

You had me a bit confused, the image that you posted was the result of the process, not the beginning of the process that you wished to automate. I thought that you wanted to copy the layered tiles, not the original background into tiles.

Translate
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
Participant ,
Jul 24, 2024 Jul 24, 2024

Sorry, my understanding is: the canvas on the left is the original image, and the layers on the right are the results after automation.

Translate
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 ,
Jul 24, 2024 Jul 24, 2024

All good, we got there in the end!

Translate
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
Participant ,
Jul 24, 2024 Jul 24, 2024

Yes, your understanding is correct as well. We finally completed it. Thank you for your help.

Translate
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 ,
Jul 24, 2024 Jul 24, 2024
Translate
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
Participant ,
Jul 24, 2024 Jul 24, 2024
LATEST

This is awesome, thank you so much.

Translate
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