Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Claire Lemoine
TP3-image
Commits
13ac8e33
Commit
13ac8e33
authored
Dec 16, 2020
by
robinechuca
Browse files
commit intermediaire
parent
9cd494d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
cache.py
cache.py
+1
-1
main.py
main.py
+6
-2
No files found.
cache.py
View file @
13ac8e33
...
...
@@ -27,4 +27,4 @@ def cache_img(support, img_a_cacher):
# Retirer les bits de poids faible de l'image à cacher et les mettre au format 4 bits, ie rendre les poids forts en faible
# Remplacer les 4 bits de poids faible du support par les 4 bits de poids fort de l'image à cacher
# Retourner l'image ainsi obtenue
return
(
support
&
0b11110000
)
+
(
cv2
.
resize
(
img_a_cacher
,
suport
.
shape
[:
2
],
interpolation
=
cv2
.
INTER_AREA
)
>>
4
)
return
(
support
&
0b11110000
)
+
(
cv2
.
resize
(
img_a_cacher
,
sup
p
ort
.
shape
[:
2
],
interpolation
=
cv2
.
INTER_AREA
)
>>
4
)
main.py
View file @
13ac8e33
...
...
@@ -19,9 +19,10 @@ def choisir(titre):
Demande a l'utilisateur de choisir une image.
"""
impath
=
tkinter
.
filedialog
.
askopenfilename
(
filetypes
=
[
(
"jpeg image"
,
"*.jpg"
),
filetypes
=
[
(
"Joint Photographic Expert Group"
,
"*.jpg"
),
(
"Joint Photographic Expert Group"
,
"*.jpeg"
)
(
"Tagged Image File Forma"
,
"*.tif"
),
(
"
p
ortable
n
etwork
g
raphics"
,
"*.png"
)],
(
"
P
ortable
N
etwork
G
raphics"
,
"*.png"
)],
initialdir
=
os
.
path
.
basename
(
os
.
path
.
abspath
(
__file__
)),
title
=
titre
)
if
not
impath
:
...
...
@@ -34,6 +35,9 @@ def choisir(titre):
return
image
def
main
():
"""
Code principale.
"""
support
=
choisir
(
"Image support"
)
cacher
=
choisir
(
"Image a cacher"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment