Overview

Let’s try the overlay feature provided by Cantaloupe.

https://cantaloupe-project.github.io/manual/5.0/overlays.html

BasicStrategy

With BasicStrategy, overlays are applied based on the settings in cantaloupe.properties.

As shown below, you can overlay an image on another image. I used the following image from Irasutoya.

https://www.irasutoya.com/2020/12/blog-post_279.html

Since I set position to bottom right in the configuration file described below, the specified image appeared in the bottom right as shown below.

I modified overlays.BasicStrategy.enabled and overlays.BasicStrategy.image in cantaloupe.properties.

###########vvvv#O#C`ueWe`eAe#V#oosrhrirbr#E#nvelelmlsl#R#teataaaoa#L#rrayhygyly#A#olsesesus#Y#lad.r.`.t.#S#syesBBeB##slttaoaa##h.erosrsps##oBgaiiai##waatec`ctc##stenSsShS##iegatttt##vcybrrror##eSmlaiara##rte=etntt##lrtegeUe##aahBg`gRg##ytoavy.yLy##sedse...##g.iretoi##ayclnyfm##r.(Saapa##e*Stybetg##`erslhe##ceae=e##oktud=##netesi##fyhgi=mvh##iseynaet##ggtgrt##uiurelp##rnstuas##eehey:##dtre/##.h#i/##imBm1##`saafa.##Bnsagb##asuilep##seacs..##iclSeb##ct.tMl##Si)ruo##toasg##rntts##a.ep##tgbo##e`yet##gS..##ycac##`ro##iPm##wpN/##itG-##lS8##ltfF##riU##ualE##stez##ee.6##gv##tyB##h`n##eo##wQ##i/##lX##l7##z##M##VAuhQMI/AAAAAAABcZ0/VI1Z9eN76pIj2rfHshveNbFoMKubXYTpACNcBGAsYHQ/s400/baby_role_towel_utsubuse.png

ScriptStrategy

With ScriptStrategy, overlays are applied based on the overlay function in the script set in delegate_script.pathname of cantaloupe.properties.

In this case, the target script file is /home/ubuntu/delegates.rb.

By setting position to repeat in the script described below, I was able to overlay images as shown below.

An example of the script is as follows:

defenr}dve'eti'rumplraoangsyei({'toip=ot>ni'o'nh=st>t=p'sr{:e}/p)/e1a.tb'p.blogspot.com/-8FUEz6vBnoQ/X7zMVAuhQMI/AAAAAAABcZ0/VI1Z9eN76pIj2rfHshveNbFoMKubXYTpACNcBGAsYHQ/s400/baby_role_towel_utsubuse.png',

When I tried the following example from the official site, resulting_size was nil and it did not work properly. I plan to continue investigating.

celnaMdedsIensNfrr{}d_eeCSst'''uIvuuipisZelrrmontErtneasso_lisgiemCannuettDUygil'i'eT(_ltolOosi=n=eFpiin>'>gFtzfgaie_=5t=ors/>en=eip3ssza'0cuetb0=ol[hnt't{tihtt}eneo)xgimt_g[shvr'iteirz'rgee]lhs[atu'<y'lw.,tiMpidInntNggh_'_'S,s]IiZz<Ee_'MC]IUNT_OSFIFZE_CUTOFFor

Text Overlay

As shown below, not only images but also text string overlays are possible. The text string is displayed in the bottom right.

This time I used the BasicStrategy described above and modified cantaloupe.properties as follows:

############vvvvv#O#C`ueWe`eOeFe#V#oosrhrirvror#E#nvelelmlelrl#R#teataaaraa#L#rrayhygylyay#A#olsesesass#Y#lad.r.`.y.l.#S#syesBBBiB##slttaoatasa##h.erosrsests##oBgaiixii##waatec`ctcoc##stenSsS.SfS##iegattttt##vcybrrrrpr##eSmlaiaaoa##rte=etnttst##lrtegeese##aahBg`ggig##ytoavy.yyby##sedse...l.##g.iretses##ayclnytt##r.(Saaprvr##e*Stybeiai##`erslnln##ceae=gug##oktude.##netess=sf##fyhgi=t,o##iseynrNn##ggtialt##uiurnka##rnstugau=##eehemn##dtreucH##.hrhe##imBal##`saa\wv##Bnsnie##asuiStt##seacahi##iclStc##ct.tota##Si)rrh##toaue##rnt##a.e-##tgl##e`yi##gS.s##yct##`r-##if##wpo##itn##lSt##lts##r##uaa##str##eeg##gu##tym##h`e##en##wt##i.##l##l#####

Summary

Cantaloupe provides a diverse range of features, and I felt that it has wide applicability. I plan to continue investigating.