# Combination of image with pcomb

**URL:** <https://discourse.radiance-online.org/t/combination-of-image-with-pcomb/5907>\
**Category:** hdri\
**Created:** [April 26, 2022, 1:52pm UTC](https://discourse.radiance-online.org/t/combination-of-image-with-pcomb/5907 "2022-04-26T13:52:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@lee](https://discourse.radiance-online.org/u/lee)\
**Post date:** [April 26, 2022, 1:52pm UTC](https://discourse.radiance-online.org/t/combination-of-image-with-pcomb/5907/1 "2022-04-26T13:52:00Z")

</div>

Hi all,  
Plenty of HDR images need to be combined cause each one represents specific part of the scene. The command is like this:

```auto
for t in {00..96}
do
  pcomb -h -e 'ro=ri(1)+ri(2)+ri(3)+ri(4)+ri(5)+ri(6)+ri(7)+ri(8);go=gi(1)+gi(2)+gi(3)+gi(4)+gi(5)+gi(6)+gi(7)+gi(8);\
  bo=bi(1)+bi(2)+bi(3)+bi(4)+bi(5)+bi(6)+bi(7)+bi(8)' \
  -o $ph3dhdr/hdr1/$t.hdr -o $ph3dhdr/hdr2/$t.hdr -o $ph3dhdr/hdr3/$t.hdr -o $ph3dhdr/hdr4/$t.hdr \
  -o $ph3dhdr/hdr5/$t.hdr -o $ph3dhdr/hdr6/$t.hdr -o $ph3dhdr/hdr7/$t.hdr -o $ph3dhdr/hdr8/$t.hdr > $ph3dhdr/hdrt/$t.hdr
done

```

The error is like this:

 ![image](https://discourse.radiance-online.org/uploads/default/original/2X/b/bb90039b18595213c43d3dd9fd9c1357cde4d182.png)  
Only when I reduced the number of images to 3 then does pcomb work well.

```auto
pcomb -h -e 'ro=ri(1)+ri(2)+ri(3);go=gi(1)+gi(2)+gi(3); bo=bi(1)+bi(2)+bi(3)' \
  -o $ph3dhdr/hdr1/$t.hdr -o $ph3dhdr/hdr2/$t.hdr -o $ph3dhdr/hdr3/$t.hdr > $ph3dhdr/hdrt/$t.hdr

```

Is this problem related to the attribute or limit of pcomb? Any reply is appreciated!

---

<div class="post-metadata">

**Author:** ![Nathaniel\_Jones](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/nathaniel_jones/32/603_2.png) [@Nathaniel\_Jones](https://discourse.radiance-online.org/u/Nathaniel_Jones)\
**Post date:** [April 26, 2022, 2:16pm UTC](https://discourse.radiance-online.org/t/combination-of-image-with-pcomb/5907/2 "2022-04-26T14:16:08Z")

</div>

Hi @lee

The issue seems to be that you have a slash character (`'\'`) inside your single-quoted argument. Can you place the entire -e argument on one line?

---

<div class="post-metadata">

**Author:** ![lee](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@lee](https://discourse.radiance-online.org/u/lee)\
**Post date:** [April 26, 2022, 2:32pm UTC](https://discourse.radiance-online.org/t/combination-of-image-with-pcomb/5907/3 "2022-04-26T14:32:20Z")

</div>

Hi @Nathaniel_Jones,  
Thanks for your rapid reply!  
It works when I remove \ in the single-quoted argument. And I tried another efficient way before your reply. And this way works well when \ exists.

```auto
pcomb $ph3dhdr/hdr1/$t.hdr -s +1 $ph3dhdr/hdr2/$t.hdr-s +1 $ph3dhdr/hdr3/$t.hdr > $ph3dhdr/hdrt/$t.hdr

```
